Use Analysis package
Contents |
Introduction
The Analysis module implements tools needed for:
- Access the reconstructed final-state-particles
- Reconstruction arbitrary decay trees
- Imposing selection criteria
- Applying kinematic fit to the decay tree (TODO)
- Saving a flat ntuple to a ROOT TTree for further analysis
The decay language
The Analysis package supports an easy-to-read string description of particle decays. The EvtGen particle naming scheme is used. The following strings are valid decay expressions:
"D0" "D0 -> K- pi+" "D0 -> [rho0 -> pi+ pi-] pi0"
A decay string may or may not contain the arrow and right-hand side. Spaces around the arrow are optional. Nested decays are expressed with square brackets.
A particle in the decay string can be labeled:
"pi+:lowpt"
"lowpt" is a label. Labels allow working with different particle lists of the same type. For example:
"D*+ -> [D0 -> K- pi+] pi+:lowpt"
A particle in the decay string can be selected using the "^" symbol:
"D0 -> ^K- ^pi+"
"K-" and "pi+" are selected here. We will consider the use cases for these features below.
The cuts language
The Analysis package contains large set of predefined variables. Most of these variables can be calculated for a given particle. Selection criteria are imposed with string expressions like:
* "M < 0.12" # the mass less than 0.12 GeV * "charge == 0" # zero electric charge * "1.8 < M < 1.9" # the mass is between 1.8 GeV and 1.9 GeV * "charge == 0 and M < 0.12" * "charge == 0 and [M < 0.12 or pt > 0.1]"
Square brackets are used to manage the order of logical operations. The following operators are available: ">", ">=", "<", "<=", "==", "!=", "and", "or".
AuroraMaster interface
An analysis procedure can be connected to the AuroraMaster instance with the add_analysis
method. An AuroraConfig
object with analysis configuration must be passed as the cfg
parameter:
am = AuroraMaster('analysis', 'info') am.add_analysis(cfg=anaysisCfg)
An analysis configuration should contain three items
anaysisCfg = AuroraConfig({ 'EventLoader' : [...], 'Combiners' : [...], 'Tuples' : [...] })
EventLoader
The EventLoader algorithm specifies lists of the final-state-particles and corresponding cuts. Its configuration is a list of dictionaries of the following format:
[ { 'decstr': 'pi+ cc', 'cutstr': 'pt > 0.10', }, { 'decstr': 'K+ cc', 'cutstr': 'pt > 0.10', }, { 'decstr': 'pi+:lowpt cc', 'cutstr': 'pt < 0.20', }, { 'decstr': 'gamma', 'cutstr': 'E > 0.07', }, ... ]
The decstr
key correspond to the decay string. "cc" at the end of the decay string means that list of anti-particles will be created, too. The configuration above leads seven lists: "pi+", "pi-", "K+", "K-", "pi+:lowpt", "pi-:lowpt", and "gamma". These lists are available for the further analysis.
Particle combiner
An analysis job usually includes several ParticleCombiner algorithms.
The simplest way to make an analysis joboption is using the AuroraMaster interface with the Analysis component.
from AuroraMaster.auroramaster import AuroraMaster, AuroraConfig from AuroraMaster.auroramaster import Analysis as A am = AuroraMaster('analysis', 'info') edminputCfg = AuroraConfig({ 'filename': './parsim.root', # should be in your run directory 'collections': ['Particles', 'allGenParticles'], }) am.add_edmi(cfg=edminputCfg) anaysisCfg = A.analysis( fsps=[ A.fspList('pi+ cc'), A.fspList('K+ cc'), ], combiners=[ A.combiner('Dkpi', 'D0 -> pi+ K-', '1.8 < M < 1.9'), ], tuples=[ A.ntuple('tup', 'D0', 'tuple.root', [ A.vars('root', ['momentumVars', 'E', 'M']), A.vars('D0 -> ^pi+ ^K-', ['momentumVars', 'pidVars', 'matchVars']), ]), ] ) am.add_analysis(cfg=anaysisCfg) am.run(evtmax=10**4)