def test_instantiate_StrippingConf_with_all_streams() : ''' Test that Stripping Streams can be instantiated. This is the most basic test that should be run when modifying or adding Stripping Streams to StrippingSelections.Streams.allStreams. ''' from StrippingConf.Configuration import StrippingConf from StrippingSelections import buildersConf stripping = buildersConf() from StrippingSelections.Utils import buildStreams streams = buildStreams(stripping) sc = StrippingConf (Streams = streams)
# #Fix for TrackEff lines # from Configurables import DecodeRawEvent DecodeRawEvent().setProp("OverrideInputs", 4.2) # Specify the name of your configuration my_wg = 'B2CC' #FOR LIAISONS # NOTE: this will work only if you inserted correctly the # default_config dictionary in the code where your LineBuilder # is defined. from StrippingSelections import buildersConf confs = buildersConf() from StrippingSelections.Utils import lineBuilder, buildStreams streams = buildStreams(confs, WGs=my_wg) leptonicMicroDSTname = 'Leptonic' charmMicroDSTname = 'Charm' pidMicroDSTname = 'PID' bhadronMicroDSTname = 'Bhadron' mdstStreams = [ leptonicMicroDSTname, charmMicroDSTname, pidMicroDSTname, bhadronMicroDSTname ] dstStreams = [ "BhadronCompleteEvent", "CharmCompleteEvent", "Dimuon", "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative"
from StrippingConf.Configuration import StrippingConf from Configurables import EventNodeKiller, ProcStatusCheck # first kill the nodes event_node_killer = EventNodeKiller("StripKiller") event_node_killer.Nodes = ["/Event/allStreams", "/Event/Strip","/Event/Leptonic" ] # Specify the name of your configuration confname='B2KLLXInclusive' #FOR USERS from StrippingSelections import buildersConf confs = buildersConf() #print confs from StrippingSelections.Utils import lineBuilder, buildStreamsFromBuilder streams = buildStreamsFromBuilder(confs,confname) #clone lines for CommonParticles overhead-free timing print "Creating line clones for timing" for s in streams: for l in s.lines: if "_TIMING" not in l.name(): cloned = l.clone(l.name().strip("Stripping")+"_TIMING") s.appendLines([cloned]) #define stream names
Modified by Andrea Contu 03/06/15 Modified by C.Khurewathanakul 15/06/15 ''' import re import sys import json # Specify the name of your configuration my_wg = sys.argv[1] #FOR LIAISONS # NOTE: this will work only if you inserted correctly the # default_config dictionary in the code where your LineBuilder # is defined. from StrippingSelections import buildersConf confs = buildersConf(WGs=[my_wg]) ## Prepare outputfile fname = 'dictionaries.py' with open(fname, 'w') as fout: ## Finally, json-dump each one. for name, config in sorted(confs.iteritems()): config.pop('NAME', None) # Strangely, some conf doesn't have 'NAME' val = json.dumps(config, sort_keys=True, indent=4) val = re.sub(r'\[\n\s+(\S+)\n\s+\]', r'[ \1 ]', val) # Pretty one-liner list val = re.sub(r'false', 'False', val) # Capitalize boolean patch val = re.sub(r'true', 'True', val) val = re.sub(r'null', 'None', val) # null-value patch entry = name + ' = ' + val + '\n\n' fout.write(entry)
from StrippingSelections import buildersConf from StrippingSelections.Utils import buildStreams conf = buildersConf() conf = {'DstarD0ToHHPi0' : conf['DstarD0ToHHPi0']} conf['DstarD0ToHHPi0']['STREAMS'] = ['CharmCompleteEvent'] hhpi0conf = conf['DstarD0ToHHPi0']['CONFIG'] hhpi0conf['D0_APT'] = 700 hhpi0conf['Kaon_PIDK'] = 0. hhpi0conf['Kaon_PT'] = 250 hhpi0conf['Kaon_TRGHOSTPROB'] = .5 hhpi0conf['Pi0M_PT'] = 250 hhpi0conf['Pi0R_PT'] = 250 hhpi0conf['Pion_PIDK'] = 5 hhpi0conf['Pion_PT'] = 250 hhpi0conf['Pion_TRGHOSTPROB'] = .5 hhpi0conf['Slowpion_PIDe'] = 10 hhpi0conf['Slowpion_PT'] = 250 hhpi0conf['Slowpion_TRGHOSTPROB'] = .5 hhpi0conf['Daughter_PT'] = 250 hhpi0conf['Daughter_IPChi2'] = 16 hhpi0conf['HH_DOCAChi2'] = 20 hhpi0conf['HH_VtxChi2NDF'] = 10 hhpi0conf['HH_FDChi2'] = 30. hhpi0conf['D0_VtxChi2NDF'] = 10 hhpi0conf['Dst_DOCAChi2'] = 20 hhpi0conf['Dst_VtxChi2NDF'] = 10 hhpi0conf['D0_DIRA'] = -1.