def test1ConstructorKeywords( self ):
      """Test proper handling of constructor keywords"""

      from AthenaCommon.Constants import ERROR, FATAL
      from GaudiSvc.GaudiSvcConf import THistSvc

      name = 'MyHistSvc'

      th1 = THistSvc( name = name, OutputLevel = FATAL )
      self.assertEqual( th1.name(), name )
      self.assertEqual( th1.OutputLevel, FATAL )

    # used to fail w/ AttributeError due to incorrect handling of KeyWords
      th2 = THistSvc( name = name, OutputLevel = ERROR )
      self.assertEqual( th2.name(), name )
      self.assertEqual( th2.OutputLevel, ERROR )
                   varsVSmean=varsVSmeanZmumu,
                   varsVSwidth=varsVSwidthZmumu,
                   varsDistr=varsDistrZmumu,
                   doFits=True,
                   doSaveFits=False,
                   OutputLevel=VERBOSE)

ToolSvc += ZmumuMon

from AthenaMonitoring.DQMonFlags import DQMonFlags
from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager
IDPerfMonManager = AthenaMonManager(
    name="IDPerfMonManager",
    FileKey=DQMonFlags.monManFileKey(),
    ManualDataTypeSetup=DQMonFlags.monManManualDataTypeSetup(),
    DataType=DQMonFlags.monManDataType(),
    Environment="user",
    ManualRunLBSetup=True,
    Run=1,
    LumiBlock=1)
IDPerfMonManager.AthenaMonTools += [ZmumuMon]

from GaudiSvc.GaudiSvcConf import THistSvc
ServiceMgr += THistSvc()
ServiceMgr.THistSvc.Output += [
    "DiMuMon DATAFILE='./DiMuMon.root' OPT='RECREATE'"
]
IDPerfMonManager.FileKey = "DiMuMon"

topSequence += IDPerfMonManager
예제 #3
0
#--------------------------------------------------------------
if MuDetCosmicFlags.doESD:
    include( "MuonCommRecExample/MuDetCosmicPOOL_jobOptions.py")
#--------------------------------------------------------------
# Monitoring Histogram  
#--------------------------------------------------------------
if MuonDQAFlags.doMuonMonitoring:
    if MuonDQAFlags.doMuonSegmMon:
        include("MuonSegmMonitoring/MuonSegmMonitoring_options.py")
        if MuDetCosmicFlags.doMoore and not MuDetCosmicFlags.doMuonboy:
            ToolSvc.MuonSegmValidation.WhichSegmCollections = [1,0]
        if MuDetCosmicFlags.doMuonboy and not MuDetCosmicFlags.doMoore:
            ToolSvc.MuonSegmValidation.WhichSegmCollections = [0,1] 	     
### Histograms Service
    from GaudiSvc.GaudiSvcConf import THistSvc
    svcMgr +=THistSvc()
    atlaspak='MuonSegmMonitoring'
    RootHistOutputFileName = str(atlaspak)+'.'+str(sampletype)+'.root'

    from MuonDQAUtils.MuonDQAUtilsConf import Muon__MuonDQATrackHistTool
    Muon__MuonDQATrackHistTool = Muon__MuonDQATrackHistTool(name = "MuonDQATrackHistTool" )
    ToolSvc += Muon__MuonDQATrackHistTool

# Writing the histogram file
    if os.path.exists(RootHistOutputFileName):
        os.remove(RootHistOutputFileName)
    # Writing the histogram files from each sub-algorithm
    svcMgr.THistSvc.Output  += ["GLOBAL DATAFILE='%s' OPT='NEW'" % RootHistOutputFileName ]
  
#--------------------------------------------------------------
# Graphics  
예제 #4
0
    'vertX:': ' constant 0.0',
    'vertY:': ' constant 0.0',
    'vertZ:': ' constant 0.0',
    't:': ' constant 0.0',
    'eta:': ' flat -0.6 0.6',
    'phi:': ' flat  0 6.28318',
    'pt:': ' constant 5000'
}

## Output printout level (DEBUG, INFO, WARNING, ERROR, FATAL)
messageSvc = Service("MessageSvc")
messageSvc.OutputLevel = WARNING

from AthenaCommon.AppMgr import ServiceMgr
from GaudiSvc.GaudiSvcConf import THistSvc
ServiceMgr += THistSvc("THistSvc")
ServiceMgr.THistSvc.Output = ["truth DATAFILE='truth.root' OPT='NEW'"]

include("G4AtlasApps/G4Atlas.flat.configuration.py")

from AthenaCommon.AlgSequence import AlgSequence
job = AlgSequence()
from AthenaCommon.CfgGetter import getAlgorithm
job += getAlgorithm("G4AtlasAlg", tryDefaultConfigurable=True)

from G4AtlasTests.G4AtlasTestsConf import G4TestAlg
job += G4TestAlg()
from AthenaCommon import CfgGetter
job.G4TestAlg.SimTestTools += [
    CfgGetter.getPrivateTool("TruthTestTool", checkType=True)
]
예제 #5
0
    CheckDCS=TileUseDCS,
    histoPathBase="/Tile/DMUErrors")

topSequence.TileLasMon.AthenaMonTools += [toolSvc.TileLasDQFragMon]
print toolSvc.TileLasDQFragMon
print topSequence.TileLasMon

import os
# -- use root histos --
# THistService for native root in Athena
if not athenaCommonFlags.isOnline(
) or storeHisto or athenaCommonFlags.isOnlineStateless():
    #theApp.HistogramPersistency = "ROOT"
    if not hasattr(svcMgr, "THistSvc"):
        from GaudiSvc.GaudiSvcConf import THistSvc
        svcMgr += THistSvc("THistSvc")
    if os.path.exists(RootHistOutputFileName):
        os.remove(RootHistOutputFileName)
    svcMgr.THistSvc.Output = [
        MonitorOutput + " DATAFILE='" + RootHistOutputFileName +
        "' OPT='RECREATE'"
    ]
else:
    from TrigServices.TrigServicesConf import TrigMonTHistSvc
    trigmonTHistSvc = TrigMonTHistSvc("THistSvc")
    svcMgr += trigmonTHistSvc

#To read CTP RESULTS and DSP Raw Channels
if not hasattr(svcMgr, "ByteStreamAddressProviderSvc"):
    from ByteStreamCnvSvcBase.ByteStreamCnvSvcBaseConf import ByteStreamAddressProviderSvc
    svcMgr += ByteStreamAddressProviderSvc()
    def __init__(self, StreamName, FileName, TreeName=None, asAlg=False):
        """Constructor for the D3PD stream object.

           Arguments:
              StreamName: Logical name of the D3PD stream. Note that beside
                          using it to define the stream in THistSvc, this
                          name is also used as the name of the TTree in the
                          output file in case one is not specified explicitly.
              FileName: Name of the file to write the D3PD TTree into.
              TreeName: Name of the TTree in the output file. If it's not
                        specified, the stream name is used as the tree name.
              asAlg: If set to True, the D3PD::MakerAlg algorithm is added
                     to the job as a regular algorithm. When set to False
                     (default), the D3PD algorithm is added to the application
                     manager as an output stream.
        """
        # Initialize the base class:
        AugmentedStreamBase.__init__(self, StreamName)

        # Check if the user specified a tree name or not:
        if TreeName == None:
            TreeName = StreamName

        # Remember the file and tree names just for bookkeeping:
        self.fileName = FileName
        self.treeName = TreeName

        # We need to add some stuff to the main algorithm sequence:
        from AthenaCommon.AlgSequence import AlgSequence
        topSequence = AlgSequence()

        # Create a sequence where the pre-D3PD-making algorithms are run:
        from D3PDMakerConfig.D3PDMakerFlags import D3PDMakerFlags
        preseq = AlgSequence(D3PDMakerFlags.PreD3PDAlgSeqName(),
                             StopOverride=True)
        if not hasattr(topSequence, D3PDMakerFlags.PreD3PDAlgSeqName()):
            topSequence += [preseq]
            pass

        # Add the AANT algorithm for making it possible to back navigate
        # from D3PD events:
        ParentStreamName = StreamName.split(':')[0]
        if StreamName.count(':') != 0:
            if StreamName.count(':') == 1:
                StreamName = StreamName.split(':')[1]
            else:
                raise AttributeError("Stream name '%s' can't be used!" %
                                     StreamName)
        if not hasattr(topSequence, ParentStreamName + "AANTStream"):
            try:
                from AnalysisTools.AnalysisToolsConf import AANTupleStream
                topSequence += AANTupleStream(ParentStreamName + "AANTStream",
                                              ExtraRefNames=[
                                                  'StreamRDO', 'StreamRAW',
                                                  'StreamESD', 'StreamAOD'
                                              ],
                                              OutputName=FileName,
                                              WriteInputDataHeader=True,
                                              StreamName=ParentStreamName)
                pass
            except ImportError:
                print self.Name, ": INFO didn't find AnalysisTools.AnalysisToolsConf in release."
                pass
            pass

        # Make sure that THistSvc exists.
        from AthenaCommon.AppMgr import ServiceMgr
        if not hasattr(ServiceMgr, 'THistSvc'):
            from GaudiSvc.GaudiSvcConf import THistSvc
            ServiceMgr += THistSvc()

        # Check if the requested stream is already defined in THistSvc:
        streamExists = False
        for s in ServiceMgr.THistSvc.Output:
            stream = s.split()[0]
            if stream == StreamName:
                streamExists = True
                break

        # Add the stream if it's not defined yet:
        if not streamExists:
            ServiceMgr.THistSvc.Output += [
                "%s DATAFILE='%s' OPT='RECREATE' CL='%i'" %
                (StreamName, FileName, D3PDMakerFlags.CompressionLevel())
            ]

        # Finally, create the D3PD::MakerAlg algorithm and add it to the job.
        # Note that here we're specifying that the D3PDMaker code should use
        # ROOT output.
        #
        # If we're adding as an algorithm directly, then pass the parent sequence
        # into MakerAlg(...). MakerAlg(...) will then add itself to the sequence
        # and also set up the accompanying filter sequence. Otherwise, we add it
        # as a stream; in that case we set up backwards compatibility for
        # 'filterSeq'.
        try:
            import D3PDMakerCoreComps
            if asAlg:
                theseq = topSequence
            else:
                theseq = None
                pass
            self.Stream = D3PDMakerCoreComps.MakerAlg(
                StreamName + "D3PDMaker",
                seq=theseq,
                file=FileName,
                stream=ParentStreamName,
                tuplename=TreeName,
                D3PDSvc="D3PD::RootD3PDSvc")

            if not asAlg:
                from AthenaCommon.AppMgr import theApp
                theApp.addOutputStream(self.Stream)
                # Backwards compatibility for the filter algoirthm:
                self.filterSeq = _RootStreamFilterHelper(self, topSequence)
                pass
            pass
        except ImportError:
            print self.Name, ": INFO didn't find D3PDMakerCoreComps in release."
            pass

        return
    0.310, 0.203, 0.347, 0.269, 0.241, 0.234, 0.234, 0.277, 0.297, 0.225,
    0.297, 0.238, 0.000, 1, 1, 1, 1
]
lucid.pmtScaling = [
    1.010, 0.000, 0.991, 0.948, 1.152, 1.221, 1.160, 0.988, 1.092, 1.063,
    1.143, 1.091, 1.109, 1.117, 1.185, 1.142, 1, 1, 1, 1, 1.023, 1.127, 1.043,
    0.986, 1.148, 0.899, 0.898, 1.098, 1.115, 1.109, 1.127, 1.043, 1.085,
    1.043, 1.063, 0.000, 1, 1, 1, 1
]
lucid.gasScaling = [
    1.176, 0.000, 1.217, 1.101, 1.143, 1.105, 1.103, 1.144, 1.075, 1.069,
    1.100, 1.208, 1.212, 1.125, 1.026, 1.037, 1, 1, 1, 1, 1.064, 0.956, 0.975,
    0.938, 1.205, 1.095, 1.137, 1.222, 1.262, 1.160, 0.923, 0.969, 1.132,
    0.969, 1.174, 0.000, 1, 1, 1, 1
]
lucid.npeThreshold = [
    17, 15, 16, 16, 18, 16, 16, 18, 17, 16, 16, 17, 19, 16, 16, 17, 15, 15, 15,
    15, 17, 16, 16, 17, 17, 15, 16, 16, 17, 16, 15, 17, 17, 15, 16, 15, 15, 15,
    15, 15
]

from GaudiSvc.GaudiSvcConf import THistSvc

if (lucid.fillRootTree):
    THistSvc = THistSvc()
    THistSvc.Output = ["AANT DATAFILE='cali.root' OPT='RECREATE'"]
    ServiceMgr += THistSvc

if DetFlags.LVL1_on():
    include("LUCID_Digitization/LUCID_LVL1Digitization_JobOptions.py")