def tuple_spec_data(name, sel_seq, template, B_meson='b', weights='./weights_soft.xml', tools=[ "TupleToolKinematic", "TupleToolPrimaries", "TupleToolEventInfo", "TupleToolTrackInfo", "TupleToolRecoStats" ], trigger_list=[ # L0 'L0HadronDecision', 'L0MuonDecision', 'L0DiMuonDecision', 'L0ElectronDecision', # HLT 1 'Hlt1TrackMVADecision', 'Hlt1TwoTrackMVADecision', 'Hlt1TrackMuonDecision', # HLT 2 'Hlt2DiMuonDetachedHeavyDecision', ] ): tp = DecayTreeTuple(name) tp.NTupleDir = '' # From Greg, might be interesting tp.TupleName = name tp_input = sel_seq if isinstance(sel_seq, str) else sel_seq.outputLocation() tp.Inputs = [tp_input] tp.setDescriptorTemplate(template) tp.ToolList += tools tt_pid = really_add_tool(tp, 'TupleToolPid') tt_pid.Verbose = True tt_geo = really_add_tool(tp, 'TupleToolGeometry') tt_geo.Verbose = True tt_tistos = really_add_tool(tp, 'TupleToolTISTOS') tt_tistos.Verbose = True tt_tistos.TriggerList = trigger_list tt_l0_calo = really_add_tool(tp, 'TupleToolL0Calo') tt_l0_calo.WhichCalo = "HCAL" tt_l0_calo.TriggerClusterLocation = "/Event/Trig/L0/Calo" tt_app_iso = getattr(tp, B_meson).addTupleTool('TupleToolApplyIsolation') tt_app_iso.WeightsFile = weights return tp
#################### ## Define ntuples # pions (test) #tuple_pions = DecayTreeTuple( 'pions' ) #tuple_pions.Decay = '[pi+]CC' #tuple_pions.Inputs = ["Phys/StdAllLoosePions/Particles"] #tuple_pions.addTool(TupleToolDecay, name="Pi") # (prompt) Lc -> p K pi line1 = "LambdaCForPromptCharm" tuple_Lc2pKpi = DecayTreeTuple('tuple_Lc2pKpi') tuple_Lc2pKpi.Inputs = ['Phys/{0}/Particles'.format(line1)] #tuple_Lc2pKpi.Decay = '[Lambda_c+ -> ^p+ ^K- ^pi+]CC' tuple_Lc2pKpi.setDescriptorTemplate( '${lcplus}[Lambda_c+ -> ${pplus}p+ ${kminus}K- ${pplus}pi+]CC') # add DecayTreeFitter tool to constrain origin to PV and refit kinematics dtftool = tuple_Lc2pKpi.lcplus.addTupleTool( 'TupleToolDecayTreeFitter/PVConstrainedDTF') dtftool.constrainToOriginVertex = True # (detached) B -> (Lc -> p K pi) mu nu #line = "SelLc2PKPiforCharmFromBSemi" #tuple_b2Lc2pKpi = DecayTreeTuple( 'tuple_b2Lc2pKpi' ) #tuple_b2Lc2pKpi.Inputs = ['Phys/{0}/Particles'.format(line)] #tuple_b2Lc2pKpi.Decay = '[ Beauty -> ^( Lambda_c+ -> ^p ^K- ^pi+ ) ^mu- ]CC' tuples = [tuple_Lc2pKpi] # Define common tuple tools tupletools = []
if (decay == "Xib2XicMuX"): striplines = [stripline.replace("L", "Xi") for stripline in striplines] if (decay == "Lc2pKpi_noipchi2"): # (prompt) Lc -> p K pi striplines = ["LambdaCLooseChi2IPForPromptCharm"] stream = "Charm" decaystring = '${lcplus}[Lambda_c+ -> ${pplus}p+ ${kminus}K- ${piplus}pi+]CC' inputtype = "MDST" #################### ## Define ntuples mytuple = DecayTreeTuple('tuple_{0}'.format(decay)) mytuple.setDescriptorTemplate(decaystring) if (inputtype == "DST"): mytuple.Inputs = [ '/Event/{0}/Phys/{1}/Particles'.format(stream, stripline) for stripline in striplines ] if (inputtype == "MDST"): mytuple.Inputs = [ 'Phys/{0}/Particles'.format(stripline) for stripline in striplines ] if (Turbo): mytuple.Inputs = [ '{0}/Particles'.format(stripline) for stripline in striplines ] if (Turbo and year in ["2015", "2016"]): mytuple.InputPrimaryVertices = '/Event/Turbo/Primary'