Angular analysis of B+->K*+(K+pi0)mumu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

463 lines
18 KiB

  1. ############# Global settings
  2. runFilters = False
  3. reference = False
  4. phsp = False
  5. BkgStudy = False
  6. data = False
  7. down = False
  8. year = "2016"
  9. stream = "AllStreams"
  10. line = "B2XMuMu_Line"
  11. #subdecay chains
  12. KShortPiPlus = True
  13. KplusPi0Merged = False
  14. KplusPi0Resolved = False
  15. from Gaudi.Configuration import *
  16. from Configurables import DaVinci
  17. from Configurables import FilterDesktop
  18. from Configurables import CombineParticles
  19. from Configurables import GaudiSequencer
  20. from Configurables import TupleToolP2VV, MCTupleToolP2VV
  21. #Run1 or Run2
  22. Run1 = True
  23. MDST = True
  24. if (year == "2011" or year == "2012"):
  25. Run1 = True
  26. elif (year == "2015" or year == "2016" or year == "2017" or year == "2018"):
  27. Run1 = False
  28. else:
  29. print "[WARNING]\tWrong year input!\n"
  30. #DST or MDST? #This is a horrible piece of code but oh well
  31. if (BkgStudy):
  32. MDST = False
  33. else:
  34. if( not data and Run1 ):
  35. MDST = False
  36. if (not KShortPiPlus):
  37. if (year == "2015" and (not data) and (not phsp) and (not reference)):
  38. MDST = False
  39. if (year == "2016" and (not data) and (not phsp) and (not reference)):
  40. MDST = False
  41. if (year == "2018" and (not data) and (not phsp) and (not reference)):
  42. MDST = False
  43. if (reference and Run1 == False and not KShortPiPlus):
  44. MDST = False
  45. if (MDST):
  46. print "\n[INFO]\tUsing MDST as input.\n"
  47. else:
  48. print "\n[INFO]\tUsing DST as input.\n"
  49. #MC Truthmatching fix for run 1 (obsolete)
  50. #if (not data and Run1):
  51. # from Configurables import PhysConf
  52. # PhysConf().CaloReProcessing=True
  53. #triggerlines
  54. if (Run1):
  55. print "[INFO]\tTriggerlines for Run 1 added!\n"
  56. triggerlines = [
  57. #l0
  58. "L0HadronDecision",
  59. "L0MuonDecision",
  60. "L0GlobalDecision",
  61. #hlt1
  62. "Hlt1TrackMuonDecision",
  63. "Hlt1DiMuonHighMassDecision",
  64. "Hlt1DiMuonLowMassDecision",
  65. "Hlt1TrackAllL0Decision",
  66. "Hlt1TrackAllL0TightDecision",
  67. "Hlt1L0AnyDecision",
  68. "Hlt1MBNoBiasDecision",
  69. "Hlt1GlobalDecision",
  70. #hlt2
  71. "Hlt2CharmHadD2HHHHDecision",
  72. "Hlt2CharmHadD2HHHHWideMassDecision",
  73. "Hlt2IncPhiDecision",
  74. "Hlt2ExpressDs2PhiPiDecision",
  75. "Hlt2Topo2BodySimpleDecision",
  76. "Hlt2Topo3BodySimpleDecision",
  77. "Hlt2Topo2BodyBBDTDecision",
  78. "Hlt2Topo3BodyBBDTDecision",
  79. "Hlt2TopoMu2BodyBBDTDecision",
  80. "Hlt2TopoMu3BodyBBDTDecision",
  81. "Hlt2TopoE2BodyBBDTDecision",
  82. "Hlt2TopoE3BodyBBDTDecision",
  83. "Hlt2RadiativeTopoTrackTOSDecision",
  84. "Hlt2RadiativeTopoPhotonL0Decision",
  85. "Hlt2SingleMuonDecision",
  86. "Hlt2DiMuonDetachedDecision",
  87. "Hlt2DiMuonDetachedHeavyDecision"]
  88. else:
  89. print "[INFO]\tTriggerlines for Run 2 added!\n"
  90. triggerlines = [
  91. #l0
  92. "L0HadronDecision",
  93. "L0MuonDecision",
  94. "L0DiMuonDecision",
  95. #"L0GlobalDecision",
  96. #hlt1
  97. "Hlt1TrackMuonDecision",
  98. "Hlt1DiMuonHighMassDecision",
  99. "Hlt1DiMuonLowMassDecision",
  100. "Hlt1TrackMVADecision",
  101. "Hlt1TwoTrackMVADecision",
  102. "Hlt1L0AnyDecision",
  103. "Hlt1MBNoBiasDecision",
  104. "Hlt1GlobalDecision",
  105. #hlt2
  106. "Hlt2Topo2BodyDecision",
  107. "Hlt2Topo3BodyDecision",
  108. "Hlt2TopoMu2BodyDecision",
  109. "Hlt2TopoMu3BodyDecision",
  110. "Hlt2TopoMuMu2BodyDecision",
  111. "Hlt2TopoMuMu3BodyDecision",
  112. "Hlt2SingleMuonDecision",
  113. "Hlt2SingleMuonHighPTDecision",
  114. "Hlt2SingleMuonLowPTDecision",
  115. "Hlt2DiMuonDetachedDecision",
  116. "Hlt2DiMuonDetachedHeavyDecision"]
  117. ############### Pre Filter, does not really do much except choose only candidates passing the Stripping line, maybe beneficial to performance
  118. #from Configurables import LoKi__HDRFilter as StripFilter
  119. #stripFilter = StripFilter( "stripPassFilter",\
  120. # Code = "HLT_PASS('StrippingB2XMuMu_LineDecision')",\
  121. # Location= "/Event/Strip/Phys/DecReports")
  122. ############# DecayTreeTuple
  123. from DecayTreeTuple.Configuration import *
  124. from Configurables import TupleToolTISTOS
  125. from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
  126. from Configurables import PrintDecayTree, PrintDecayTreeTool
  127. ############# MCDecayTreeTuple
  128. from Configurables import MCDecayTreeTuple
  129. from Configurables import MCTupleToolKinematic, TupleToolMCBackgroundInfo, TupleToolMCTruth
  130. #Fix Truthmatching
  131. from Configurables import BackgroundCategory,Calo2MCTool,DaVinciSmartAssociator
  132. ##subpid stuff
  133. #from Configurables import SubPIDMMFilter
  134. from Configurables import SubstitutePID ,BTaggingTool
  135. from Configurables import TupleToolDecayTreeFitter, TupleToolTrackIsolation, TupleToolConeIsolation
  136. from Configurables import LoKi__Hybrid__TupleTool
  137. ##########################################
  138. ###B+ -> (K*(892)+ -> KS0 pi+) mu+ mu- ### (> 1 <)
  139. ##########################################
  140. ### AND/OR ###
  141. ##########################################################
  142. ###B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) mu+ mu- ### (> 2 <)
  143. ##########################################################
  144. #This is probably a very stupid idea but python should be okay with it
  145. b2KstmumuTupleList= []
  146. b2KstmumuTupleList.append(DecayTreeTuple("b2KstKs0pimumu_Tuple"))
  147. b2KstmumuTupleList.append(DecayTreeTuple("b2KstKpi0mumuResolvedTuple"))
  148. for b2KstmumuTuple in b2KstmumuTupleList:
  149. if (MDST):
  150. b2KstmumuTuple.RootInTES = '/Event/{0}'.format(stream)
  151. b2KstmumuTuple.Inputs = ['Phys/{0}/Particles'.format(line)]
  152. else:
  153. b2KstmumuTuple.Inputs = ['{0}/Phys/{1}/Particles'.format(stream, line)]
  154. #decay descriptor
  155. b2KstmumuTupleList[0].Decay = "[B+ -> ^(K*(892)+ -> ^(KS0 -> ^pi+ ^pi-) ^pi+) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
  156. b2KstmumuTupleList[0].addBranches({
  157. "B_plus" : "^([B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC)" ,
  158. "K_star_plus" : "[B+ -> ^(K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
  159. "K_short" : "[B+ -> (K*(892)+ -> ^(KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
  160. "Ks_pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> ^pi+ pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
  161. "Ks_pi_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ ^pi-) pi+) (J/psi(1S) -> mu- mu+)]CC",
  162. "pi_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) ^pi+) (J/psi(1S) -> mu- mu+)]CC",
  163. "J_psi" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) ^(J/psi(1S) -> mu- mu+)]CC",
  164. "mu_minus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> ^mu- mu+)]CC",
  165. "mu_plus" : "[B+ -> (K*(892)+ -> (KS0 -> pi+ pi-) pi+) (J/psi(1S) -> mu- ^mu+)]CC"
  166. })
  167. b2KstmumuTupleList[1].Decay = "[B+ -> ^(K*(892)+ -> ^K+ ^(pi0 -> ^gamma ^gamma)) ^(J/psi(1S) -> ^mu- ^mu+)]CC"
  168. b2KstmumuTupleList[1].addBranches({
  169. "B_plus" : "^([B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC)",
  170. "K_star_plus" : "[B+ -> ^(K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
  171. "K_plus" : "[B+ -> (K*(892)+ -> ^K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
  172. "pi_zero_resolved" : "[B+ -> (K*(892)+ -> K+ ^(pi0 -> gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
  173. "gamma1" : "[B+ -> (K*(892)+ -> K+ (pi0 -> ^gamma gamma)) (J/psi(1S) -> mu- mu+)]CC",
  174. "gamma2" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma ^gamma)) (J/psi(1S) -> mu- mu+)]CC",
  175. "J_psi" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) ^(J/psi(1S) -> mu- mu+)]CC",
  176. "mu_minus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> ^mu- mu+)]CC",
  177. "mu_plus" : "[B+ -> (K*(892)+ -> K+ (pi0 -> gamma gamma)) (J/psi(1S) -> mu- ^mu+)]CC"
  178. })
  179. #add tools
  180. for b2KstmumuTuple in b2KstmumuTupleList:
  181. b2KstmumuTuple.ToolList = ["TupleToolKinematic",
  182. "TupleToolPrimaries",
  183. "TupleToolEventInfo",
  184. "TupleToolTrackInfo",
  185. "TupleToolRecoStats",
  186. "TupleToolAngles",
  187. "TupleToolPid",
  188. "TupleToolPhotonInfo"]
  189. #add MCtools
  190. if not (data):
  191. b2KstmumuMCTuple = b2KstmumuTuple.addTupleTool("TupleToolMCTruth/b2KstmumuMCTuple")
  192. b2KstmumuMCTuple.addTupleTool("MCTupleToolHierarchy")
  193. b2KstmumuTuple.ToolList += ["MCTupleToolKinematic",
  194. "TupleToolMCBackgroundInfo"]
  195. #Adding Angle Calculator
  196. b2KstmumuTuple.B_plus.addTool(TupleToolMCTruth, name="B_plusMCTruth")
  197. b2KstmumuTuple.B_plus.ToolList = [ "TupleToolMCTruth/B_plusMCTruth"]
  198. b2KstmumuTuple.B_plus.B_plusMCTruth.ToolList = [ "MCTupleToolP2VV/B2KsMuMu"]
  199. b2KstmumuTuple.B_plus.B_plusMCTruth.addTool( MCTupleToolP2VV, name="B2KsMuMu" )
  200. b2KstmumuTuple.B_plus.B_plusMCTruth.B2KsMuMu.Calculator = 'MCBu2KstarMuMuAngleCalculator'
  201. #add tools to branches
  202. if (KplusPi0Resolved):
  203. b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolPi0Info")
  204. b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolCaloHypo")
  205. b2KstmumuTupleList[1].pi_zero_resolved.addTupleTool("TupleToolGeometry/Geo")
  206. b2KstmumuTupleList[1].pi_zero_resolved.Geo.Verbose = True
  207. b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolProtoPData")
  208. b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolPhotonInfo")
  209. if (year != "2018" and year !="2015"): b2KstmumuTupleList[1].gamma1.addTupleTool("TupleToolCaloHypo")
  210. b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolProtoPData")
  211. b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolPhotonInfo")
  212. if (year != "2018" and year !="2015"): b2KstmumuTupleList[1].gamma2.addTupleTool("TupleToolCaloHypo")
  213. for b2KstmumuTuple in b2KstmumuTupleList:
  214. b2KstmumuTuple.B_plus.addTupleTool("TupleToolGeometry/Geo")
  215. b2KstmumuTuple.B_plus.Geo.Verbose = True
  216. b2KstmumuTuple.B_plus.addTupleTool("TupleToolPropertime")
  217. #Adding Angle Calculator
  218. TupleToolP2VV_Bu = TupleToolP2VV('TupleToolP2VV_Bu')
  219. TupleToolP2VV_Bu.Calculator = 'Bu2KstarMuMuAngleCalculator'
  220. b2KstmumuTuple.B_plus.addTool(TupleToolP2VV_Bu)
  221. b2KstmumuTuple.B_plus.ToolList += ["TupleToolP2VV/TupleToolP2VV_Bu"]
  222. b2KstmumuTuple.K_star_plus.addTupleTool("TupleToolGeometry/Geo")
  223. b2KstmumuTuple.K_star_plus.Geo.Verbose = True
  224. b2KstmumuTuple.J_psi.addTupleTool("TupleToolGeometry/Geo")
  225. b2KstmumuTuple.J_psi.Geo.Verbose = True
  226. b2KstmumuTuple.mu_minus.addTupleTool("TupleToolGeometry/Geo")
  227. b2KstmumuTuple.mu_minus.Geo.Verbose = True
  228. b2KstmumuTuple.mu_plus.addTupleTool("TupleToolGeometry/Geo")
  229. b2KstmumuTuple.mu_plus.Geo.Verbose = True
  230. if (KShortPiPlus):
  231. b2KstmumuTupleList[0].K_short.addTupleTool("TupleToolGeometry/Geo")
  232. b2KstmumuTupleList[0].K_short.Geo.Verbose = True
  233. b2KstmumuTupleList[0].pi_plus.addTupleTool("TupleToolGeometry/Geo")
  234. b2KstmumuTupleList[0].pi_plus.Geo.Verbose = True
  235. if (KplusPi0Resolved):
  236. b2KstmumuTupleList[1].K_plus.addTupleTool("TupleToolGeometry/Geo")
  237. b2KstmumuTupleList[1].K_plus.Geo.Verbose = True
  238. ### DST isolation info tools ###
  239. for b2KstmumuTuple in b2KstmumuTupleList:
  240. if not(MDST):
  241. b2KstmumuTuple.addTupleTool("TupleToolTrackIsolation/TrackIso")
  242. b2KstmumuTuple.TrackIso.Verbose = True
  243. b2KstmumuTuple.addTupleTool("TupleToolConeIsolation/ConeIso")
  244. b2KstmumuTuple.addTool(TupleToolDecay, name="TupleToolDecayBplus")
  245. #decay tree fitter (DTF)
  246. b2KstmumuTuple.B_plus.addTupleTool('TupleToolDecayTreeFitter/DTF')
  247. b2KstmumuTuple.B_plus.DTF.constrainToOriginVertex = True
  248. b2KstmumuTuple.B_plus.DTF.UpdateDaughters = True
  249. b2KstmumuTuple.B_plus.DTF.Verbose = True
  250. #Add mass constraints
  251. if (KShortPiPlus):
  252. b2KstmumuTupleList[0].B_plus.DTF.daughtersToConstrain = ['KS0']
  253. if (KplusPi0Resolved):
  254. b2KstmumuTupleList[1].B_plus.DTF.daughtersToConstrain = ['pi0']
  255. #LoKi tools
  256. for b2KstmumuTuple in b2KstmumuTupleList:
  257. LoKiToolb2KstmumuTuple = b2KstmumuTuple.addTupleTool("LoKi::Hybrid::TupleTool/LoKiToolb2KstmumuTuple")
  258. LoKiToolb2KstmumuTuple.Variables = {"ETA" : "ETA" ,
  259. "PHI" : "PHI" ,
  260. "DOCA1" : "DOCA(1,2)" ,
  261. "CONEANGLE" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEANGLE', -1.)",
  262. "CONEMULT" : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEMULT', -1.)",
  263. 'CONEPTASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEPTASYM', -1.)",
  264. 'CONEPT': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEPT', -1.)",
  265. 'CONEP': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEP', -1.)",
  266. 'CONEPASYM' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEPASYM', -1.)",
  267. 'CONEDELTAETA' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEDELTAETA', -1.)",
  268. 'CONEDELTAPHI' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/ConeIsoInfo', 'CONEDELTAPHI', -1.)",
  269. 'VTXISONUMVTX' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/VtxIsoInfo', 'VTXISONUMVTX', -1.)",
  270. 'VTXISODCHI2ONETRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/VtxIsoInfo', 'VTXISODCHI2ONETRACK', -1.)",
  271. 'VTXISODCHI2MASSONETRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/VtxIsoInfo', 'VTXISODCHI2MASSONETRACK', -1.)",
  272. 'VTXISODCHI2TWOTRACK' : "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/VtxIsoInfo', 'VTXISODCHI2TWOTRACK', -1.)",
  273. 'VTXISODCHI2MASSTWOTRACK': "RELINFO('/Event/" + stream + "/Phys/B2XMuMu_Line/VtxIsoInfo', 'VTXISODCHI2MASSTWOTRACK', -1.)"
  274. };
  275. #trigger config
  276. b2KstmumuTT = b2KstmumuTuple.addTupleTool(TupleToolTISTOS)
  277. b2KstmumuTT.TriggerList = triggerlines
  278. b2KstmumuTT.FillL0 = True
  279. b2KstmumuTT.FillHlt1 = True
  280. b2KstmumuTT.FillHlt2 = True
  281. b2KstmumuTT.Verbose = True
  282. b2KstmumuTT.VerboseL0 = True
  283. b2KstmumuTT.VerboseHlt1 = True
  284. b2KstmumuTT.VerboseHlt2 = True
  285. ###########################
  286. ## Main sequence
  287. ###########################
  288. b2KstmumuSeq = GaudiSequencer("b2KstmumuSeq")
  289. if (KShortPiPlus):
  290. b2KstmumuSeq.Members += [b2KstmumuTupleList[0]]
  291. if (KplusPi0Resolved):
  292. b2KstmumuSeq.Members += [b2KstmumuTupleList[1]]
  293. b2KstmumuSeq.ModeOR = True
  294. b2KstmumuSeq.ShortCircuit = False
  295. ###########################
  296. ## DaVinci configurations
  297. ###########################
  298. dv = DaVinci()
  299. #dv.EventPreFilters = [stripFilter]
  300. dv.UserAlgorithms += [b2KstmumuSeq]
  301. if(MDST):
  302. dv.InputType = "MDST"
  303. else:
  304. dv.InputType = "DST"
  305. dv.RootInTES = "/Event/{0}".format(stream)
  306. dv.DataType = year
  307. dv.Simulation = not data
  308. dv.Lumi = True
  309. #dv.VerboseMessages = True
  310. dv.EvtMax = -1 #10000 #100000 #100000
  311. dv.PrintFreq = 1000
  312. dv.TupleFile = "b2Kstmumu.root"
  313. #This should have been a dictionary, big time, but oh well :)
  314. #tags from http://lhcb-release-area.web.cern.ch/LHCb-release-area/DOC/dbase/conddb/release_notes.html
  315. DBtags_data = {
  316. "2011": ["cond-20150409-1", "dddb-20150928"],
  317. "2012": ["cond-20150409-1", "dddb-20150928"],
  318. "2015": ["cond-20150828", "dddb-20150724"],
  319. "2016": ["cond-20161004", "dddb-20150724"],
  320. "2017": ["cond-20170724", "dddb-20170721-3"],
  321. "2018": ["cond-20180202", "dddb-20171030-3"]
  322. }
  323. DBtags_Kplus_sigMC = {
  324. "2011": ["20160614-1", "20160318-1"],
  325. "2012": ["20160321-2", "20150928" ],
  326. "2015": ["20161124", "20170721-3" ],
  327. "2016": ["20170721-2", "20170721-3" ],
  328. "2017": ["20180411", "20170721-3" ],
  329. "2018": ["20190430", "20170721-3" ]
  330. }
  331. DBtags_Kplus_refMC = {
  332. "2011": ["20160614-1", "20160318-1"],
  333. "2012": ["20160321-2", "20150928" ],
  334. "2015": ["20161124", "20170721-3"],
  335. "2016": ["20170721-2", "20170721-3"],
  336. "2017": ["", ""],
  337. "2018": ["", ""]
  338. }
  339. DBtags_Kplus_PHSP = {
  340. "2011": ["20160614-1", "20170721-1"],
  341. "2012": ["20160321-2", "20170721-2"],
  342. "2015": ["20161124", "20170721-3"],
  343. "2016": ["20170721-2", "20170721-3"],
  344. "2017": ["20180411", "20170721-3"],
  345. "2018": ["20190128", "20170721-3"]
  346. }
  347. DBtags_Kshort_sigMC = {
  348. "2011": ["20160614-1", "20160318-1"],
  349. "2012": ["20160321-2", "20150928" ],
  350. "2015": ["20161124", "20150724" ],
  351. "2016": ["20170721-2", "20170721-3"],
  352. "2017": ["20180411", "20170721-3"],
  353. "2018": ["", ""]
  354. }
  355. DBtags_Kshort_refMC = {
  356. "2011": ["20160614-1", "20160318-1"],
  357. "2012": ["20160321-2", "20150928" ],
  358. "2015": ["", ""],
  359. "2016": ["20170721-2", "20170721-3"],
  360. "2017": ["", ""],
  361. "2018": ["", ""]
  362. }
  363. DBtags_Kshort_PHSP = {
  364. "2011": ["20160614-1", "20170721-1"],
  365. "2012": ["20160321-2", "20170721-2"],
  366. "2015": ["20161124", "20170721-3"],
  367. "2016": ["20170721-2", "20170721-3"],
  368. "2017": ["20180411", "20170721-3"],
  369. "2018": ["20190128", "20170721-3"]
  370. }
  371. polarity_tag = "-vc-md100" if(down) else "-vc-mu100"
  372. used_dict = {}
  373. if (data):
  374. dv.CondDBtag = DBtags_data[year][0]
  375. dv.DDDBtag = DBtags_data[year][1]
  376. else:
  377. if (KplusPi0Resolved):
  378. if (reference): used_dict = DBtags_Kplus_refMC
  379. elif (phsp): used_dict = DBtags_Kplus_PHSP
  380. else: used_dict = DBtags_Kplus_sigMC
  381. if (KShortPiPlus):
  382. if (reference): used_dict = DBtags_Kshort_refMC
  383. elif (phsp): used_dict = DBtags_Kshort_PHSP
  384. else: used_dict = DBtags_Kshort_sigMC
  385. dv.CondDBtag = "sim-"+used_dict[year][0]+polarity_tag
  386. dv.DDDBtag = "dddb-"+used_dict[year][1]