Belle II Software light-2609-luna
generatedDecayWeights.py
1#!/usr/bin/env python3
2
9
10"""
11Generated-decay calibration weights for FEI B candidates.
12"""
13
14import basf2 as b2
15from modeSelector import config
16from ROOT import Belle2
17from variables import variables as vm
18
19DEFAULT_GEN_DMID_VARIABLE = 'genDecayModeID'
20DEFAULT_WEIGHT_VARIABLE = 'genFEICalibWeight'
21INVALID_DMID = -1
22REST_DMID = 999
23
24SIGNED_FSTATES = (511, 521, 211, 321, 411, 413, 421, 423, 431, 433, 2212, 4122)
25UNSIGNED_FSTATES = (111, 310, 443)
26DDSTAR_ABS_PDGS = frozenset((411, 413, 421, 423))
27OTHER_ABS_PDGS = frozenset((11, 13, 2212, 2112, 130))
28NO_ANCESTOR_ABS_PDGS = frozenset((211, 321, 411, 413, 421, 423, 431, 433, 2212, 4122, 111, 443))
29NO_ANCESTOR_WO_DSP_ABS_PDGS = frozenset((211, 321, 411, 421, 423, 431, 433, 2212, 4122, 111, 443))
30N_SIGNATURE_VALUES = len(SIGNED_FSTATES) * 2 + len(UNSIGNED_FSTATES) + 1
31SIGNATURE_EXTRA_INFO_KEYS = (
32 [f'n_neg_{pdg}' for pdg in SIGNED_FSTATES] +
33 [f'n_pos_{pdg}' for pdg in SIGNED_FSTATES] +
34 [f'n_pos_{pdg}' for pdg in UNSIGNED_FSTATES] +
35 ['n_other']
36)
37
38MODE_SIGNATURE_MAP = {
39 (0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0): (-521, 0),
40 (0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0): (521, 0),
41 (0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0): (-521, 1),
42 (0, 0, 0, 0, 0, 0, 1, 0,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0, 1, 0, 0, 0, 0, 2): (-511, 31),
174 (0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2): (511, 31),
175}
176
177
178def get_calibration_dm_id(pdg, exact_dm_id, rest_dmid=REST_DMID):
179 """
180 Collapse the exact generated FEI mode to the calibration granularity.
181 """
182 if abs(int(pdg)) not in (511, 521):
183 return INVALID_DMID
184 if exact_dm_id is None:
185 return rest_dmid
186 if exact_dm_id in config.get_fei_calibration_map(pdg):
187 return int(exact_dm_id)
188 return rest_dmid
189
190
191def get_generated_calibration_weight(pdg, gen_dm_id, rest_dmid=REST_DMID):
192 """
193 Return the weight for a generated calibration dmID.
194 """
195 if abs(int(pdg)) not in (511, 521):
196 return 1.0
197 if gen_dm_id == INVALID_DMID:
198 return 1.0
199 if gen_dm_id == rest_dmid:
200 return config.get_fei_calibration_rest(pdg)
201 return config.get_fei_calibration_map(pdg).get(int(gen_dm_id), config.get_fei_calibration_rest(pdg))
202
203
204def _abs_pdg(particle):
205 """Return the absolute value of a particle's PDG code."""
206 return abs(int(particle.getPDG()))
207
208
209def _is_primary_particle(particle):
210 """Return True if particle is a generator-level primary particle."""
211 if hasattr(particle, 'isPrimaryParticle'):
212 return bool(particle.isPrimaryParticle())
213 if hasattr(particle, 'hasStatus') and hasattr(Belle2, 'MCParticle'):
214 status_flag = getattr(Belle2.MCParticle, 'c_PrimaryParticle', None)
215 if status_flag is not None:
216 return bool(particle.hasStatus(status_flag))
217 return True
218
219
220def _belongs_to_root(particle, root_index):
221 """Return True if particle is a descendant of the MCParticle with the given array index."""
222 mother = particle.getMother()
223 while mother:
224 if int(mother.getArrayIndex()) == root_index:
225 return True
226 mother = mother.getMother()
227 return False
228
229
230def _ancestor_distance(particle, target_abs_pdg):
231 """Return the number of steps to the nearest ancestor with the given absolute PDG code, or 0 if none."""
232 distance = 1
233 mother = particle.getMother()
234 while mother:
235 if _abs_pdg(mother) == target_abs_pdg:
236 return distance
237 mother = mother.getMother()
238 distance += 1
239 return 0
240
241
242def _has_any_abs_ancestor(particle, abs_pdgs):
243 """Return True if any ancestor of particle has an absolute PDG code in abs_pdgs."""
244 mother = particle.getMother()
245 while mother:
246 if _abs_pdg(mother) in abs_pdgs:
247 return True
248 mother = mother.getMother()
249 return False
250
251
252def _count_descendants(descendants, predicate):
253 """Count the number of particles in descendants for which predicate returns True."""
254 return sum(1 for particle in descendants if predicate(particle))
255
256
257def _build_mode_signature(root_particle, descendants):
258 """Build the decay-mode signature tuple for a B meson and its generator-level descendants."""
259 root_pdg = int(root_particle.getPDG())
260 expand_dsp = False
261
262 n_ddstar = _count_descendants(
263 descendants,
264 lambda particle: _abs_pdg(particle) in DDSTAR_ABS_PDGS and not _has_any_abs_ancestor(particle, DDSTAR_ABS_PDGS),
265 )
266 n_jpsi = _count_descendants(descendants, lambda particle: _abs_pdg(particle) == 443)
267 n_ks = _count_descendants(
268 descendants,
269 lambda particle: _abs_pdg(particle) == 310 and not _has_any_abs_ancestor(particle, DDSTAR_ABS_PDGS),
270 )
271 n_p = _count_descendants(descendants, lambda particle: _abs_pdg(particle) == 2212)
272 split_ks = (n_ddstar == 2 or n_jpsi == 1) and n_ks > 0
273 if abs(root_pdg) == 521 and n_p == 0 and n_ks == 0:
274 expand_dsp = True
275
276 def count_signed(target_pdg, exclude_dsp=False):
277 excluded = NO_ANCESTOR_WO_DSP_ABS_PDGS if exclude_dsp else NO_ANCESTOR_ABS_PDGS
278 return _count_descendants(
279 descendants,
280 lambda particle: int(particle.getPDG()) == target_pdg and not _has_any_abs_ancestor(particle, excluded),
281 )
282
283 def count_signed_wo_ks(target_pdg, exclude_dsp=False):
284 excluded = NO_ANCESTOR_WO_DSP_ABS_PDGS if exclude_dsp else NO_ANCESTOR_ABS_PDGS
285 return _count_descendants(
286 descendants,
287 lambda particle: int(particle.getPDG()) == target_pdg
288 and not _has_any_abs_ancestor(particle, excluded)
289 and _ancestor_distance(particle, 310) == 0,
290 )
291
292 signature = []
293 for pdg in SIGNED_FSTATES:
294 if pdg in (511, 521):
295 signature.append(1 if root_pdg == -pdg else 0)
296 continue
297 if pdg == 413:
298 if expand_dsp:
299 signature.append(0)
300 elif split_ks:
301 signature.append(count_signed_wo_ks(-pdg))
302 else:
303 signature.append(count_signed(-pdg))
304 continue
305 if expand_dsp:
306 signature.append(count_signed(-pdg, exclude_dsp=True))
307 elif split_ks:
308 signature.append(count_signed_wo_ks(-pdg))
309 else:
310 signature.append(count_signed(-pdg))
311
312 for pdg in SIGNED_FSTATES:
313 if pdg in (511, 521):
314 signature.append(1 if root_pdg == pdg else 0)
315 continue
316 if pdg == 413:
317 if expand_dsp:
318 signature.append(0)
319 elif split_ks:
320 signature.append(count_signed_wo_ks(pdg))
321 else:
322 signature.append(count_signed(pdg))
323 continue
324 if expand_dsp:
325 signature.append(count_signed(pdg, exclude_dsp=True))
326 elif split_ks:
327 signature.append(count_signed_wo_ks(pdg))
328 else:
329 signature.append(count_signed(pdg))
330
331 signature.append(count_signed(111, exclude_dsp=expand_dsp) if not split_ks else count_signed_wo_ks(111))
332 if expand_dsp:
333 signature.append(count_signed(310, exclude_dsp=True))
334 elif split_ks:
335 signature.append(count_signed_wo_ks(310))
336 else:
337 signature.append(0)
338 signature.append(count_signed(443, exclude_dsp=expand_dsp) if not split_ks else count_signed_wo_ks(443))
339
340 n_other = _count_descendants(
341 descendants,
342 lambda particle: (
343 _abs_pdg(particle) in OTHER_ABS_PDGS
344 and not _has_any_abs_ancestor(particle, NO_ANCESTOR_ABS_PDGS)
345 and _ancestor_distance(particle, 310) == 0
346 ) or (
347 int(particle.getPDG()) == 22
348 and particle.getEnergy() > 0.1
349 and particle.getMother()
350 and abs(int(particle.getMother().getPDG())) in (511, 521)
351 ),
352 )
353 signature.append(n_other)
354 return tuple(signature)
355
356
357def _signature_to_dict(signature):
358 """Convert a signature tuple to a dict keyed by SIGNATURE_EXTRA_INFO_KEYS."""
359 return dict(zip(SIGNATURE_EXTRA_INFO_KEYS, signature))
360
361
362def get_exact_dmid_from_signature(signature):
363 """
364 Return the exact FEI pdg and dmID for one generated-decay signature.
365 """
366 match = MODE_SIGNATURE_MAP.get(tuple(signature))
367 if match is None:
368 return None, None
369 return match
370
371
372def _match_generated_mode(root_particle, descendants, use_calibrated_dmids_only=True):
373 """Match a B meson's decay to a known FEI mode and return a dict with pdg, dm IDs, weight, and signature."""
374 signature = _build_mode_signature(root_particle, descendants)
375 pdg, exact_dm_id = get_exact_dmid_from_signature(signature)
376 if exact_dm_id is None:
377 return {
378 'pdg': int(root_particle.getPDG()),
379 'exact_dm_id': None,
380 'gen_dm_id': get_calibration_dm_id(root_particle.getPDG(), None),
381 'weight': get_generated_calibration_weight(root_particle.getPDG(), REST_DMID),
382 'signature': signature,
383 }
384
385 if use_calibrated_dmids_only:
386 gen_dm_id = get_calibration_dm_id(pdg, exact_dm_id)
387 else:
388 gen_dm_id = int(exact_dm_id)
389 return {
390 'pdg': pdg,
391 'exact_dm_id': exact_dm_id,
392 'gen_dm_id': gen_dm_id,
393 'weight': get_generated_calibration_weight(pdg, get_calibration_dm_id(pdg, exact_dm_id)),
394 'signature': signature,
395 }
396
397
398def _build_event_truth_cache(particles, use_calibrated_dmids_only=True):
399 """Build a map from B meson array index to its generated-mode match dict for all B mesons in the event."""
400 cache = {}
401 primary_particles = [particle for particle in particles if _is_primary_particle(particle)]
402 roots = [particle for particle in primary_particles if _abs_pdg(particle) in (511, 521)]
403 for root_particle in roots:
404 root_index = int(root_particle.getArrayIndex())
405 descendants = [
406 particle for particle in primary_particles
407 if _belongs_to_root(particle, root_index)
408 ]
409 cache[root_index] = _match_generated_mode(
410 root_particle,
411 descendants,
412 use_calibrated_dmids_only=use_calibrated_dmids_only,
413 )
414 return cache
415
416
418 """
419 Assign generated-decay dmIDs and calibration weights to FEI candidates.
420 """
421
423 self,
424 bp_list,
425 b0_list,
426 gen_dmid_variable=DEFAULT_GEN_DMID_VARIABLE,
427 weight_variable=DEFAULT_WEIGHT_VARIABLE,
428 rest_dmid=REST_DMID,
429 use_calibrated_dmids_only=True,
430 store_btag_candidate_signature=False,
431 ):
432 """Initialise module parameters."""
433 super().__init__()
434
435 self.bp_list = bp_list
436
437 self.b0_list = b0_list
438
439 self.gen_dmid_variable = gen_dmid_variable
440
441 self.weight_variable = weight_variable
442
443 self.rest_dmid = rest_dmid
444
445 self.use_calibrated_dmids_only = use_calibrated_dmids_only
446
447 self.store_btag_candidate_signature = store_btag_candidate_signature
448
449 self._validated = False
450
451 def initialize(self):
452 """Validate configuration once at the start of processing."""
454
456 """Raise a fatal error if any module parameter is invalid."""
457 if self._validated:
458 return
459 if not isinstance(self.bp_list, str) or not self.bp_list.startswith('B+:'):
460 b2.B2FATAL(f"ModeSelector generated weights: invalid bp_list '{self.bp_list}'")
461 if not isinstance(self.b0_list, str) or not self.b0_list.startswith('B0:'):
462 b2.B2FATAL(f"ModeSelector generated weights: invalid b0_list '{self.b0_list}'")
463 if not isinstance(self.gen_dmid_variable, str) or not self.gen_dmid_variable:
464 b2.B2FATAL("ModeSelector generated weights: gen_dmid_variable must be a non-empty string")
465 if not isinstance(self.weight_variable, str) or not self.weight_variable:
466 b2.B2FATAL("ModeSelector generated weights: weight_variable must be a non-empty string")
467 if int(self.rest_dmid) != REST_DMID:
468 b2.B2FATAL(f"ModeSelector generated weights: rest_dmid must be {REST_DMID}")
469 if not isinstance(self.use_calibrated_dmids_only, bool):
470 b2.B2FATAL(
471 "ModeSelector generated weights: use_calibrated_dmids_only must be bool"
472 )
473 if not isinstance(self.store_btag_candidate_signature, bool):
474 b2.B2FATAL(
475 "ModeSelector generated weights: store_btag_candidate_signature must be bool"
476 )
477 self._validated = True
478
479 @staticmethod
480 def _normalize_int(value):
481 """Return int(value), or None if value is NaN."""
482 return None if value != value else int(value)
483
484 @staticmethod
485 def _set_extra_info(particle, key, value):
486 """Set or add an ExtraInfo entry on a particle."""
487 if particle.hasExtraInfo(key):
488 particle.setExtraInfo(key, value)
489 else:
490 particle.addExtraInfo(key, value)
491
492 @staticmethod
494 """Return True if the event is not a continuum event."""
495 is_cont = vm.evaluate('isContinuumEvent', particle)
496 return int(is_cont) != 1
497
498 @staticmethod
499 def _report_missing_truth_annotation(list_name, particle, reason):
500 """Emit a B2ERROR for a non-continuum candidate missing its truth annotation."""
501 b2.B2ERROR(
502 "ModeSelector generated weights: non-continuum candidate missing generated "
503 f"B truth annotation in {list_name} (array index {particle.getArrayIndex()}): {reason}"
504 )
505
506 def _annotate_list(self, list_name, truth_cache):
507 """Annotate all candidates in list_name using the pre-built truth_cache."""
508 plist = Belle2.PyStoreObj(list_name)
509 if not plist.isValid():
510 return
511
512 particle_list = plist.obj()
513 for i in range(plist.getListSize()):
514 particle = particle_list.getParticle(i)
515 btag_index = self._normalize_int(vm.evaluate('mostcommonBTagIndex', particle))
516 tag_pdg = self._normalize_int(vm.evaluate('mostcommonBTagPDG', particle))
517 is_non_continuum = self._is_non_continuum_event(particle)
518
519 gen_dm_id = INVALID_DMID
520 weight = config.FEI_CALIB_CONT
521 match = None
522 if btag_index is None:
523 if is_non_continuum:
524 self._report_missing_truth_annotation(list_name, particle, 'mostcommonBTagIndex is NaN')
525 elif tag_pdg is None:
526 if is_non_continuum:
527 self._report_missing_truth_annotation(list_name, particle, 'mostcommonBTagPDG is NaN')
528 elif abs(tag_pdg) not in (511, 521):
529 if is_non_continuum:
531 list_name,
532 particle,
533 f'mostcommonBTagPDG={tag_pdg} is not a B0 or B+ PDG'
534 )
535 else:
536 match = truth_cache.get(btag_index)
537 if match is None:
538 if is_non_continuum:
540 list_name,
541 particle,
542 f'mostcommonBTagIndex={btag_index} is not present in the event truth cache'
543 )
544 else:
545 gen_dm_id = match['gen_dm_id']
546 weight = match['weight']
547
548 self._set_extra_info(particle, self.gen_dmid_variable, float(gen_dm_id))
549 self._set_extra_info(particle, self.weight_variable, float(weight))
551 if match is None:
552 signature_values = (0,) * N_SIGNATURE_VALUES
553 else:
554 signature_values = match['signature']
555 for key, value in _signature_to_dict(signature_values).items():
556 self._set_extra_info(particle, key, float(value))
557
558 def event(self):
559 """Annotate all B candidates with generated decay mode IDs and calibration weights."""
560 bp_plist = Belle2.PyStoreObj(self.bp_list)
561 b0_plist = Belle2.PyStoreObj(self.b0_list)
562 bp_empty = not bp_plist.isValid() or bp_plist.getListSize() == 0
563 b0_empty = not b0_plist.isValid() or b0_plist.getListSize() == 0
564 if bp_empty and b0_empty:
565 return
566
567 mc_particles = Belle2.PyStoreArray('MCParticles')
568 particles = [mc_particles[index] for index in range(mc_particles.getEntries())]
569 truth_cache = _build_event_truth_cache(
570 particles,
571 use_calibrated_dmids_only=self.use_calibrated_dmids_only,
572 )
573 self._annotate_list(self.bp_list, truth_cache)
574 self._annotate_list(self.b0_list, truth_cache)
575
576
577def addGeneratedDecayWeights(
578 bp_list,
579 b0_list,
580 gen_dmid_variable=DEFAULT_GEN_DMID_VARIABLE,
581 weight_variable=DEFAULT_WEIGHT_VARIABLE,
582 rest_dmid=REST_DMID,
583 use_calibrated_dmids_only=True,
584 store_btag_candidate_signature=False,
585 path=None,
586):
587 """
588 Add generated-decay calibration annotations to FEI candidate lists.
589 """
590 if path is None:
591 b2.B2FATAL("ModeSelector generated weights: path is required")
592
593 path.add_module(
595 bp_list=bp_list,
596 b0_list=b0_list,
597 gen_dmid_variable=gen_dmid_variable,
598 weight_variable=weight_variable,
599 rest_dmid=rest_dmid,
600 use_calibrated_dmids_only=use_calibrated_dmids_only,
601 store_btag_candidate_signature=store_btag_candidate_signature,
602 )
603 )
A Class to store the Monte Carlo particle information.
Definition MCParticle.h:32
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
Definition PyStoreObj.h:67
__init__(self, bp_list, b0_list, gen_dmid_variable=DEFAULT_GEN_DMID_VARIABLE, weight_variable=DEFAULT_WEIGHT_VARIABLE, rest_dmid=REST_DMID, use_calibrated_dmids_only=True, store_btag_candidate_signature=False)
store_btag_candidate_signature
Whether to store the full btag candidate signature as ExtraInfo.
bool _validated
Internal flag: True after configuration has been validated.
gen_dmid_variable
ExtraInfo key name for the generated decay mode ID.
rest_dmid
Decay mode ID used for the rest (non-calibrated) category.
use_calibrated_dmids_only
Whether to restrict to calibrated decay mode IDs only.
weight_variable
ExtraInfo key name for the calibration weight.