diff --git a/EtaDecays/README.md b/EtaDecays/README.md new file mode 100644 index 0000000000000000000000000000000000000000..408312ba8e11dff5642479d8beeade4a9e23dead --- /dev/null +++ b/EtaDecays/README.md @@ -0,0 +1,4 @@ +# Add n-tuples to EtaDecays for BDT systematic computations + +Create the n-tuples for $D_s^+\to(\phi\to\mu\mu) \pi\pi\pi$ to compute the BDT systematics +of $\pi\pi\mu\mu$ channels. \ No newline at end of file diff --git a/EtaDecays/__init__.py b/EtaDecays/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/EtaDecays/ds3piphi_data.py b/EtaDecays/ds3piphi_data.py new file mode 100644 index 0000000000000000000000000000000000000000..3c8b389c31d9b32db77c034486cde44d64daeb76 --- /dev/null +++ b/EtaDecays/ds3piphi_data.py @@ -0,0 +1,136 @@ +from Configurables import DecayTreeTuple, GaudiSequencer, DaVinci +from Configurables import LoKi__Hybrid__DTFDict as DTFDict +from Configurables import LoKi__Hybrid__Dict2Tuple +from Configurables import LoKi__Hybrid__DictOfFunctors +from DecayTreeTuple.Configuration import addBranches + + +def add_dtf_branches(dtt): + DictTuple = dtt.Ds.addTupleTool(LoKi__Hybrid__Dict2Tuple, "DTFTuple") + DictTuple.addTool(DTFDict, "DTF") + DictTuple.Source = "LoKi::Hybrid::DTFDict/DTF" + DictTuple.NumVar = 10 + DictTuple.DTF.constrainToOriginVertex = True + DictTuple.DTF.daughtersToConstrain = ["D_s+"] + + DictTuple.DTF.addTool(LoKi__Hybrid__DictOfFunctors, "dict") + DictTuple.DTF.Source = "LoKi::Hybrid::DictOfFunctors/dict" + DictTuple.DTF.dict.Variables = { + "DTFDict_Ds_PT" : "PT", + "DTFDict_Ds_M" : "M", + "DTFDict_phi_PT": "CHILD(PT,1)", + "DTFDict_CHI2" : "DTF_CHI2(True)", + "DTFDict_NDOF" : "DTF_NDOF(True)" + } + for key in ["M", "PX", "PY", "PZ"]: + DictTuple.DTF.dict.Variables.update({ + "DTFDict_phi_"+key: "CHILD({0}, 'D_s+ -> pi+ pi- pi+ ^(phi(1020) -> mu+ mu-)')"\ + .format(key)}) + + +def add_mother_branches(mother, LoKi_Ds, parname): + ''' + Function to add branches to the mother particle + + :ntuple: DecayTreeTuple, ntuple object to configure + :LoKi_Ds: dict, contains the tuple tools of all different particles + ''' + LoKi_Ds[parname] = mother.addTupleTool("LoKi__Hybrid__TupleTool/LoKi_"+parname) + LoKi_Ds[parname].Variables = {"VCHI2PERDOF": "VFASPF(VCHI2/VDOF)", + "ETA" : "ETA", "PHI": "PHI", + "ADMASS" : "ADMASS('D_s+')", + "BPVIPCHI2" : "BPVIPCHI2()", + "BPVDIRA" : "BPVDIRA", + "BPVVDCHI2" : "BPVVDCHI2", + "DOCA" : "DOCAMAX", + "DOCACHI2" : "DOCACHI2MAX", + } + + +def add_particle_branches(par, LoKi_Ds, parname): + ''' + Function to add branches to the daughter particles + + :ntuple: DecayTreeTuple, ntuple object to configure + :LoKi_Ds: dict, contains the tuple tools of all different particles + ''' + LoKi_Ds[parname] = par.addTupleTool("LoKi__Hybrid__TupleTool/LoKi_"+parname) + LoKi_Ds[parname].Variables = {"ETA": "ETA", "PHI": "PHI", + "PCOV11" : "PCOV2(1,1)", + "PCOV12" : "PCOV2(1,2)", + "PCOV13" : "PCOV2(1,3)", + "PCOV22" : "PCOV2(2,2)", + "PCOV23" : "PCOV2(2,3)", + "PCOV33" : "PCOV2(3,3)", + "PERR2" : "PERR2", + "PTERR2" : "PTERR2", + "M2ERR2" : "M2ERR2", + "TRCHI2DOF": "TRCHI2DOF", + "MIPCHI2DV": "MIPCHI2DV(PRIMARY)"} + + +def add_general_branches(ntuple): + ''' + Function to add branches to all particles + + :ntuple: DecayTreeTuple, ntuple object to configure + :strip: ConfigureStripping, object containing the stripping config info + ''' + ntuple.ToolList = ["TupleToolEventInfo", + "TupleToolPropertime", + "TupleToolTrackInfo", + "TupleToolPid", + "TupleToolANNPID", + "TupleToolMuonPid", + "TupleToolGeometry", + "TupleToolKinematic", + "TupleToolRecoStats"] + + LoKi_Ds = {} + for par in ["Ds", "phi"]: + add_mother_branches(getattr(ntuple, par), LoKi_Ds, par) + + for par in ["pip", "pim", "pi", "mup", "mum"]: + add_particle_branches(getattr(ntuple, par), LoKi_Ds, par) + + +def add_trigger_branches(ntuple): + ''' + Function to add trigger branches + + :ntuple: DecayTreeTuple, ntuple object to configure + ''' + mytriggerlist = ["L0HadronDecision", "L0MuonDecision", + "Hlt1TrackMVADecision", "Hlt1TwoTrackMVADecision", + "Hlt2TopoMu3BodyDecision", "Hlt2TopoMuMu2BodyDecision", + "Hlt2DiMuonDetachedDecision", "Hlt2TopoMu2BodyDecision"] + ntuple.addTupleTool("TupleToolTISTOS/TISTOSTool") + ntuple.TISTOSTool.VerboseL0 = True + ntuple.TISTOSTool.VerboseHlt1 = True + ntuple.TISTOSTool.VerboseHlt2 = True + ntuple.TISTOSTool.TriggerList = mytriggerlist + + +dtt = DecayTreeTuple("DTTDsPi3PhiStrip") +dtt.Decay = "D_s+ -> ^pi+ ^pi- ^pi+ ^(phi(1020) -> ^mu+ ^mu-)" +dtt.Inputs = ["Charm/Phys/Etap2pipimumuDs2PhiLine/Particles"] +dtt.addBranches({"Ds": "D_s+ -> pi+ pi- pi+ (phi(1020) -> mu+ mu-)", + "pip": "D_s+ -> ^pi+ pi- pi+ (phi(1020) -> mu+ mu-)", + "pim": "D_s+ -> pi+ ^pi- pi+ (phi(1020) -> mu+ mu-)", + "pi" : "D_s+ -> pi+ pi- ^pi+ (phi(1020) -> mu+ mu-)", + "phi": "D_s+ -> pi+ pi- pi+ ^(phi(1020) -> mu+ mu-)", + "mup": "D_s+ -> pi+ pi- pi+ (phi(1020) -> ^mu+ mu-)", + "mum": "D_s+ -> pi+ pi- pi+ (phi(1020) -> mu+ ^mu-)"}) + +add_dtf_branches(dtt) + +add_general_branches(dtt) + +add_trigger_branches(dtt) + +gs = GaudiSequencer("myseq") +gs.Members += [dtt] + +DaVinci().UserAlgorithms += [gs] +#DaVinci().DataType = "2016" +#DaVinci().Simulation = True diff --git a/EtaDecays/ds3piphi_mc.py b/EtaDecays/ds3piphi_mc.py new file mode 100644 index 0000000000000000000000000000000000000000..d429798f23f19fa57993668c646e47c9a0307163 --- /dev/null +++ b/EtaDecays/ds3piphi_mc.py @@ -0,0 +1,143 @@ +from Configurables import DecayTreeTuple, GaudiSequencer, DaVinci, MCDecayTreeTuple +from Configurables import LoKi__Hybrid__DTFDict as DTFDict +from Configurables import LoKi__Hybrid__Dict2Tuple +from Configurables import LoKi__Hybrid__DictOfFunctors +from DecayTreeTuple.Configuration import addBranches + + +def add_dtf_branches(dtt): + DictTuple = dtt.Ds.addTupleTool(LoKi__Hybrid__Dict2Tuple, "DTFTuple") + DictTuple.addTool(DTFDict, "DTF") + DictTuple.Source = "LoKi::Hybrid::DTFDict/DTF" + DictTuple.NumVar = 10 + DictTuple.DTF.constrainToOriginVertex = True + DictTuple.DTF.daughtersToConstrain = ["D_s+"] + + DictTuple.DTF.addTool(LoKi__Hybrid__DictOfFunctors, "dict") + DictTuple.DTF.Source = "LoKi::Hybrid::DictOfFunctors/dict" + DictTuple.DTF.dict.Variables = { + "DTFDict_Ds_PT" : "PT", + "DTFDict_Ds_M" : "M", + "DTFDict_phi_PT": "CHILD(PT,1)", + "DTFDict_CHI2" : "DTF_CHI2(True)", + "DTFDict_NDOF" : "DTF_NDOF(True)" + } + for key in ["M", "PX", "PY", "PZ"]: + DictTuple.DTF.dict.Variables.update({ + "DTFDict_phi_"+key: "CHILD({0}, 'D_s+ -> pi+ pi- pi+ ^(phi(1020) -> mu+ mu-)')"\ + .format(key)}) + + +def add_mother_branches(mother, LoKi_Ds, parname): + ''' + Function to add branches to the mother particle + + :ntuple: DecayTreeTuple, ntuple object to configure + :LoKi_Ds: dict, contains the tuple tools of all different particles + ''' + LoKi_Ds[parname] = mother.addTupleTool("LoKi__Hybrid__TupleTool/LoKi_"+parname) + LoKi_Ds[parname].Variables = {"VCHI2PERDOF": "VFASPF(VCHI2/VDOF)", + "ETA" : "ETA", "PHI": "PHI", + "ADMASS" : "ADMASS('D_s+')", + "BPVIPCHI2" : "BPVIPCHI2()", + "BPVDIRA" : "BPVDIRA", + "BPVVDCHI2" : "BPVVDCHI2", + "DOCA" : "DOCAMAX", + "DOCACHI2" : "DOCACHI2MAX", + } + + +def add_particle_branches(par, LoKi_Ds, parname): + ''' + Function to add branches to the daughter particles + + :ntuple: DecayTreeTuple, ntuple object to configure + :LoKi_Ds: dict, contains the tuple tools of all different particles + ''' + LoKi_Ds[parname] = par.addTupleTool("LoKi__Hybrid__TupleTool/LoKi_"+parname) + LoKi_Ds[parname].Variables = {"ETA": "ETA", "PHI": "PHI", + "PCOV11" : "PCOV2(1,1)", + "PCOV12" : "PCOV2(1,2)", + "PCOV13" : "PCOV2(1,3)", + "PCOV22" : "PCOV2(2,2)", + "PCOV23" : "PCOV2(2,3)", + "PCOV33" : "PCOV2(3,3)", + "PERR2" : "PERR2", + "PTERR2" : "PTERR2", + "M2ERR2" : "M2ERR2", + "TRCHI2DOF": "TRCHI2DOF", + "MIPCHI2DV": "MIPCHI2DV(PRIMARY)"} + + +def add_general_branches(ntuple): + ''' + Function to add branches to all particles + + :ntuple: DecayTreeTuple, ntuple object to configure + :strip: ConfigureStripping, object containing the stripping config info + ''' + ntuple.ToolList = ["TupleToolEventInfo", + "TupleToolPropertime", + "TupleToolTrackInfo", + "TupleToolPid", + "TupleToolANNPID", + "TupleToolMuonPid", + "TupleToolGeometry", + "TupleToolKinematic", + "TupleToolRecoStats"] + + LoKi_Ds = {} + for par in ["Ds", "phi"]: + add_mother_branches(getattr(ntuple, par), LoKi_Ds, par) + + for par in ["pip", "pim", "pi", "mup", "mum"]: + add_particle_branches(getattr(ntuple, par), LoKi_Ds, par) + + +def add_trigger_branches(ntuple): + ''' + Function to add trigger branches + + :ntuple: DecayTreeTuple, ntuple object to configure + ''' + mytriggerlist = ["L0HadronDecision", "L0MuonDecision", + "Hlt1TrackMVADecision", "Hlt1TwoTrackMVADecision", + "Hlt2TopoMu3BodyDecision", "Hlt2TopoMuMu2BodyDecision", + "Hlt2DiMuonDetachedDecision", "Hlt2TopoMu2BodyDecision"] + ntuple.addTupleTool("TupleToolTISTOS/TISTOSTool") + ntuple.TISTOSTool.VerboseL0 = True + ntuple.TISTOSTool.VerboseHlt1 = True + ntuple.TISTOSTool.VerboseHlt2 = True + ntuple.TISTOSTool.TriggerList = mytriggerlist + +mcdtt = MCDecayTreeTuple("MCDecayTreeTuple") +mcdtt.Decay = "D_s+ => ^pi+ ^pi- ^pi+ ^(phi(1020) ==> ^mu+ ^mu-)" +mcdtt.addBranches({"Ds": "D_s+ => pi+ pi- pi+ (phi(1020) ==> mu+ mu-)", + "pip": "D_s+ => ^pi+ pi- pi+ (phi(1020) ==> mu+ mu-)", + "pim": "D_s+ => pi+ ^pi- pi+ (phi(1020) ==> mu+ mu-)", + "pi" : "D_s+ => pi+ pi- ^pi+ (phi(1020) ==> mu+ mu-)", + "phi": "D_s+ => pi+ pi- pi+ ^(phi(1020) ==> mu+ mu-)", + "mup": "D_s+ => pi+ pi- pi+ (phi(1020) ==> ^mu+ mu-)", + "mum": "D_s+ => pi+ pi- pi+ (phi(1020) ==> mu+ ^mu-)"}) + +dtt = DecayTreeTuple("DTTDsPi3PhiStrip") +dtt.Decay = "D_s+ -> ^pi+ ^pi- ^pi+ ^(phi(1020) -> ^mu+ ^mu-)" +dtt.Inputs = ["AllStreams/Phys/Etap2pipimumuDs2PhiLine/Particles"] +dtt.addBranches({"Ds": "D_s+ -> pi+ pi- pi+ (phi(1020) -> mu+ mu-)", + "pip": "D_s+ -> ^pi+ pi- pi+ (phi(1020) -> mu+ mu-)", + "pim": "D_s+ -> pi+ ^pi- pi+ (phi(1020) -> mu+ mu-)", + "pi" : "D_s+ -> pi+ pi- ^pi+ (phi(1020) -> mu+ mu-)", + "phi": "D_s+ -> pi+ pi- pi+ ^(phi(1020) -> mu+ mu-)", + "mup": "D_s+ -> pi+ pi- pi+ (phi(1020) -> ^mu+ mu-)", + "mum": "D_s+ -> pi+ pi- pi+ (phi(1020) -> mu+ ^mu-)"}) + +add_dtf_branches(dtt) + +add_general_branches(dtt) + +add_trigger_branches(dtt) + +gs = GaudiSequencer("myseq") +gs.Members += [mcdtt, dtt] + +DaVinci().UserAlgorithms += [gs] diff --git a/EtaDecays/info.yaml b/EtaDecays/info.yaml new file mode 100644 index 0000000000000000000000000000000000000000..f73b762a1abda71e14feaf151c17b95cfec117b0 --- /dev/null +++ b/EtaDecays/info.yaml @@ -0,0 +1,69 @@ +MCDs3PiPhi2016_Down: + application: DaVinci/v44r10p5 + input: + bk_query: /MC/2016/Beam6500GeV-2016-MagDown-Nu1.6-25ns-Pythia8/Sim09h/Trig0x6139160F/Reco16/Turbo03a/Stripping28r2NoPrescalingFlagged/23175001/ALLSTREAMS.DST + options: + - ds3piphi_mc.py + output: MCDs3PiPhi.root + +MCDs3PiPhi2016_Up: + application: DaVinci/v44r10p5 + input: + bk_query: /MC/2016/Beam6500GeV-2016-MagUp-Nu1.6-25ns-Pythia8/Sim09h/Trig0x6139160F/Reco16/Turbo03a/Stripping28r2NoPrescalingFlagged/23175001/ALLSTREAMS.DST + options: + - ds3piphi_mc.py + output: MCDs3PiPhi.root + +DataDs3PiPhi2016_Up: + application: DaVinci/v44r10p5 + input: + bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco16/Stripping28r2/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + +DataDs3PiPhi2016_Down: + application: DaVinci/v44r10p5 + input: + bk_query: /LHCb/Collision16/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco16/Stripping28r2/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + +DataDs3PiPhi2017_Down: + application: DaVinci/v42r11p2 + input: + bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco17/Stripping29r2p1/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + +DataDs3PiPhi2017_Up: + application: DaVinci/v42r11p2 + input: + bk_query: /LHCb/Collision17/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco17/Stripping29r2p1/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + +DataDs3PiPhi2018_Down: + application: DaVinci/v44r11p1 + input: + bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagDown/Real Data/Reco18/Stripping34r0p1/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + +DataDs3PiPhi2018_Up: + application: DaVinci/v44r11p1 + input: + bk_query: /LHCb/Collision18/Beam6500GeV-VeloClosed-MagUp/Real Data/Reco18/Stripping34r0p1/90000000/CHARM.MDST + options: + - ds3piphi_data.py + output: DataDs3PiPhi.root + + +defaults: + inform: miguel.fernandez.gomez@cern.ch + wg: Charm + automatically_configure: true