Esempio n. 1
0
def ReStrip(mylines, stripping="stripping21r0p1", streamname=None):

    from Configurables import EventNodeKiller, ProcStatusCheck
    from StrippingArchive.Utils import buildStreams
    from StrippingArchive import strippingArchive
    from StrippingConf.Configuration import StrippingStream
    from StrippingConf.Configuration import StrippingConf
    from StrippingSettings.Utils import strippingConfiguration

    NodeKiller = EventNodeKiller("StripKiller")
    NodeKiller.Nodes = ["/Event/AllStreams", "/Event/Strip"]

    from StrippingSelections import buildersConf
    from StrippingSelections.Utils import lineBuilder, buildStreamsFromBuilder

    config = strippingConfiguration(stripping)
    archive = strippingArchive(stripping)
    streams = buildStreams(stripping=config, archive=archive)

    #confs = buildersConf()

    mystream = StrippingStream("MyStream")
    #for name in confnames:
    #    streams = buildStreamsFromBuilder(confs,name)
    for stream in streams:
        #if streamname not in stream : continue
        for line in stream.lines:
            print line
            if line.name() in mylines:
                print "Adding ", line.name(), "for restripping"
                mystream.appendLines([line])

    restrip = StrippingConf(Streams=[mystream],
                            MaxCandidates=2000,
                            AcceptBadEvents=False,
                            BadEventSelection=ProcStatusCheck(),
                            TESPrefix='Strip',
                            ActiveMDSTStream=True)
    #Verbose = True,
    #MicroDSTStreams = streams )
    return restrip, [NodeKiller, restrip.sequence()]
Esempio n. 2
0
def getLinelist(my_wg, strippingVersion):
    """Lists all the lines with the <my_wg> specified in its
    default condif dictionary ['WG'] key"""
    linelist = []
    for myWG in my_wg:
        # CVS: Defining aliases for certain WGs.
        if myWG == 'BnoC': myWG = 'Charmless'
        elif myWG == 'Calib': myWG = 'Calibration'
        elif myWG == 'SL': myWG = 'Semileptonic'
        if myWG not in [
                'B2CC', 'B2OC', 'BandQ', 'Charmless', 'Calibration', 'Charm',
                'QEE', 'RD', 'Semileptonic'
        ]:
            raise ValueError(myWG + ' WG not defined')
        # CVS: Removed 'MiniBias', does not exist as a WG tag itself.
        WGList = [myWG]
        myStreams = buildStreams('stripping' + strippingVersion, WGs=WGList)
        for stream in myStreams:
            for line in stream.lines:
                linelist.append(line.name().strip('Stripping'))
    return linelist
Esempio n. 3
0
#get the configuration dictionary from the database
config = strippingConfiguration(stripping)
#get the line builders from the archive
archive = strippingArchive(stripping)

#########################
# Fix Bu2LLK config for S29r2, which was not updated in Settings but is correct in Archive
from StrippingArchive.Stripping29r2.StrippingRD.StrippingBu2LLK import default_config as Bu2LLK_config
config = dict(config)
config['Bu2LLK']['CONFIG'] = Bu2LLK_config['CONFIG']

# only in this stripping. Now sure what's the need of this in our case
#########################

streams = buildStreams(stripping=config, archive=archive)

#OUTPUT STREAM NAME
AllStreams = StrippingStream("b2dhh.Strip")

linesToAdd = []

#LIST OF FILTERED LINES

MyLines = [
    'StrippingX2LcPiPiSSLc2PKPiBeauty2CharmLine',
    'StrippingX2LcKPiSSLc2PKPiBeauty2CharmLine',
    'StrippingX2LcKKSSLc2PKPiBeauty2CharmLine',
    'StrippingB2DHHOSD2HHHCFPIDBeauty2CharmLine'
]
Esempio n. 4
0
    EventNodeKiller,
    ProcStatusCheck,
    DaVinci,
    DecayTreeTuple
)
from GaudiConf import IOHelper
from DecayTreeTuple.Configuration import *

# Node killer: remove the previous Stripping
event_node_killer = EventNodeKiller('StripKiller')
event_node_killer.Nodes = ['/Event/AllStreams', '/Event/Strip']

# Build a new stream called 'CustomStream' that only
# contains the desired line
strip = 'stripping21'
streams = buildStreams(stripping=strippingConfiguration(strip),
                       archive=strippingArchive(strip))

custom_stream = StrippingStream('CustomStream')
custom_line = 'StrippingD2hhCompleteEventPromptDst2D2RSLine'

for stream in streams:
    for line in stream.lines:
        if line.name() == custom_line:
            custom_stream.appendLines([line])

line = 'D2hhCompleteEventPromptDst2D2RSLine'

# Create the actual Stripping configurable
filterBadEvents = ProcStatusCheck()

sc = StrippingConf(Streams=[custom_stream],
for stage, lines in HltLines.iteritems():
    for line in lines: myTriggerList.append( stage+line+'Decision' )



#kill the previous stripping just in case (it is not the case) your file was already stripped.
from Configurables import EventNodeKiller
killer = EventNodeKiller('Stripkiller')
killer.Nodes = ['/Event/AllStreams', '/Event/Strip']



stripping='stripping20r0p2'
config  = strippingConfiguration(stripping)
archive = strippingArchive(stripping)
streams = buildStreams(stripping=config, archive=archive)



# Select my line
MyStream = StrippingStream("MyStream")
MyLines = ['StrippingBetaSQ2B3piSelectionLine']

for stream in streams: 
    for line in stream.lines:
        if line.name() in MyLines:
            MyStream.appendLines( [ line ] ) 


# Configure Stripping
from Configurables import ProcStatusCheck
Esempio n. 6
0
#myconf = "B2threebody"
# NOTE: this will work only if you inserted correctly the
# default_config dictionary in the code where your LineBuilder
# is defined.

from StrippingConf.Configuration import StrippingConf, StrippingStream
from StrippingSettings.Utils import strippingConfiguration
from StrippingArchive.Utils import buildStreams
from StrippingArchive import strippingArchive

#get the configuration dictionary from the database
conf = strippingConfiguration(stripping)
#get the line builders from the archive
archive = strippingArchive(stripping)

streams = buildStreams(stripping=conf, archive=archive, WGs=["___wg___"])

#streams = buildStreams(stripping = conf, archive = archive)

#dictreportsline = []
#for s in streams:
#  dictreportsline.append("StrippingStream"+s.name()+"Decision")
## for l in s.lines:
#   dictreportsline.append(l.name()+"Decision")

leptonicMicroDSTname = 'Leptonic'
charmMicroDSTname = 'Charm'
pidMicroDSTname = 'PID'
bhadronMicroDSTname = 'Bhadron'
mdstStreams = [
    leptonicMicroDSTname, charmMicroDSTname, pidMicroDSTname,
Esempio n. 7
0
 def __init__(self, version) :
     self.version = prepend_stripping(version)
     self.config  = strippingConfiguration(self.version)
     self.archive = strippingArchive(self.version)
     self.streams = buildStreams(stripping=self.config, archive=self.archive) 
Esempio n. 8
0
from StrippingSettings.Utils import strippingConfiguration
from StrippingArchive.Utils import buildStreams
from StrippingArchive import strippingArchive
from Configurables import (EventNodeKiller, ProcStatusCheck, DaVinci,
                           DecayTreeTuple)
from GaudiConf import IOHelper
from DecayTreeTuple.Configuration import *

# Node killer: remove the previous Stripping
event_node_killer = EventNodeKiller('StripKiller')
event_node_killer.Nodes = ['/Event/AllStreams', '/Event/Strip']

# Build a new stream called 'CustomStream' that only
# contains the desired line
strip = 'stripping21'
streams = buildStreams(stripping=strippingConfiguration(strip),
                       archive=strippingArchive(strip))

custom_stream = StrippingStream('CustomStream')
custom_line = 'StrippingD2hhCompleteEventPromptDst2D2RSLine'

for stream in streams:
    for line in stream.lines:
        if line.name() == custom_line:
            custom_stream.appendLines([line])

line = 'D2hhCompleteEventPromptDst2D2RSLine'

# Create the actual Stripping configurable
filterBadEvents = ProcStatusCheck()

sc = StrippingConf(Streams=[custom_stream],
Esempio n. 9
0
from Gaudi.Configuration import *

from CommonParticles.Utils import DefaultTrackingCuts

from Configurables import DaVinci

from StrippingConf.Configuration import StrippingConf
from StrippingArchive.Utils import buildStreams

allStreams = buildStreams('Stripping24')

MessageSvc().Format = "% F%60W%S%7W%R%T %0W%M"

#
# Stripping job configuration
#

sc = StrippingConf(Streams=allStreams)

from DSTWriters.microdstelements import *
from DSTWriters.Configuration import (SelDSTWriter, stripDSTStreamConf,
                                      stripDSTElements,
                                      stripMicroDSTStreamConf,
                                      stripMicroDSTElements,
                                      stripCalibMicroDSTStreamConf)

SelDSTWriterElements = {
    'default': stripDSTElements(),
}

SelDSTWriterConf = {
Esempio n. 10
0
def get_streams(version) :
    config  = strippingConfiguration(version)
    archive = strippingArchive(version)
    streams = buildStreams(stripping=config, archive=archive) 
    return streams