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.

446 lines
17 KiB

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