Use Analysis package

From Charm-Tau Detector
(Difference between revisions)
Jump to: navigation, search
Line 34: Line 34:
  
 
== The cuts language ==
 
== 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 =
 
= AuroraMaster interface =
  
 
The simplest way to make an analysis joboption is using the AuroraMaster interface with the Analysis component.
 
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)
  
 
= Low level interface =
 
= Low level interface =

Revision as of 18:19, 6 February 2021

Contents

Introduction

The Analysis module implements all tools needed for:

  • Selection the final-state-particles reconstructed in the detector
  • Construction arbitrary decay tree
  • Imposing selection criteria
  • Applying kinematic fit to the decay tree (TODO)
  • Saving flat ntuple for the selected candidates

The decay language

An easy to read and to write string description of particle decay is used in the Analysis package. Particle names correspond to EvtGen naming scheme. The following strings are valid decay expressions:

"D0"
"D0 -> K- pi+"
"D0 -> [rho0 -> pi+ pi-] pi0"

As can be seen from the examples, a decay may or may not contain right-hand side. Left-hand and right-hand sides are separated by arrow "->". Spaces around the arrow are optional. Nested decays are expressed with square brackets.

Particle in a decay can have a label:

"pi+:lowpt"

Here "lowpt" is a label. Labels allow working with different particle lists of the same type. For example:

"D*+ -> [D0 -> K- pi+] pi+:lowpt"

Finally, particle in a decay can be selected with the "^" symbol:

"D0 -> ^K- ^pi+"

Here "K-" and "pi+" are selected. This syntax is used to connect ntuple variables and particles as shown 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

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)

Low level interface

Personal tools