`LoKi::Cuts`

namespace here.
This page refers to DaVinci v22r1.

- Particle Functors
- ALL: All
- ABSID: Absolute value of PID.
- ACHILD: Compute a function on a particle in an array
- ADMASS: The absolute mass difference to the reference value
- ADPDGM and ADPDGMASS: The absolute mass difference to the nominal mass
- AMAXCHILD or AMINCHILD: cut an array and return the max/min value of a functor.
- BPVDIRA: Direction angle
- BPVIPCHI2(): IP on related PV
- BPVLTFITCHI2: the of the proper lifetime fit.
- BPVLTIME: the proper lifetime of the particle
- BPVLTCHI2: the -significance of the proper lifetime of the particle
- BPVLTSIGNCHI2: the signed -significance of the proper lifetime of the particle
- BPVVDCHI2: -separation from related PV
- BPVVDZ: -distance from the end vertex of the particle and the related primary vertex.
- BPVVDR: -distance from the end vertex of the particle and the related primary vertex.
- BPVVDRHO: -distance from the end vertex of the particle and the related primary vertex.
- CHI2PDGM and CHI2PDGMASS: The mass difference to the nominal mass in units of chi2
- CHI2M and CHI2MASS: The mass difference to some reference mass in units of chi2
- CHILDCUT: Applies a cut to a given child
- DECTREE: Check if a particle satisfies a certain decay descriptor
- DMASS: The mass difference to the reference value
- DPDGM and DPDGMASS: The mass difference to the nominal mass
- ID: Particle ID
- INGENERATION: "in generation"
- INTREE: In tree
- MAXTREE: Maximum value in the decay tree
- MINTREE: Minimal value in the decay tree
- MINVDDV: minimum distance between the particle's end-vertex and any other vertex
- MINVDSOURCE: minimum distance between the particle's end-vertex and any other vertex
- MINVDTES: minimum distance between the particle's end-vertex and any other vertex
- MIPCHI2DV: Minimum IP-
- MIPDV: Minimum IP
- M: Mass
- MM: Measured Mass
- NINGENERATION: "Number of particles in generation"
- NINTREE: Number of particles in tree
- NMASS: The nominal mass of a particle
- P: Momentum
- PIDe, PIDmu, PIDK, PIDp, PIDpi : PID
- PT: Transverse momentum
- TRCHI2: the track fit
- TRCHI2DOF: per degree of freedom of the track fit
- TRPCHI2: -probability the track fit
- VDMIN: Distance of two vertices
- VFASPF: Vertex Function as Particle Function.

- Particle Array Functors
- AHASCHILD: Checks if there is a particle in the array that matches the requirements
- ADAMASS: The absolute mass difference to the PDG reference value
- AM: Mass of the combination
- AMAXCHILD, AMINCHILD: Maximal, minimal value in array.
- AMAXDOCA, AMINDOCA: Distance of closest approach cut
- AMAXDOCACHI2, AMINDOCACHI2: Distance of closest approach significance cut
- ANUM: Number of particles in the array meeting a requirement
- AP: Sum momentum of the array
- APT: Sum transverse momentum of the array

- Vertex functors
- VX, VY, VZ: Vertex x, y or z-position
- VCHI2 : Vertex
- VDOF : Vertex fit number of degrees of freedom
- VMINVDDV: minimum distance between the vertex and any other vertex
- VMINVDSOURCE: minimum distance between the vertex and any other vertex
- VMINVDTES: minimum distance between the vertex and any other vertex
- VPCHI2: -probability

- Units
- Syntax
- Use of CombineParticles.
- Help
- Feature requests
- Few related tools/algorithms.

Some mnemonic rules:

- The functors with the prefix
`BPV`

deal with "the best primary vertex". The best primary vertex is extracted from the desktop-tool using the method`IPhysDesktop::relatedVertex`

- The functors with the suffix
`DV`

get some even-data (e.g. the list of all vertices) through desktop tool - The functors with the suffix
`TES`

get the event data from the Transient Event Store - The
`VD`

as a part of the functor name means that the functor deals with "vertex distance" - The
`VDCHI2`

as a part of the functor name means that the functor deals with "vertex -distance" - The
`SIGN`

as a part of the functor name means that functor return the value of or distance artificially signed according to some criteria. - The
`IP`

stands for "impact parameter" and`MIP`

means "the minimal (with reswpect to some set of vertices) value of impact parameter" - Practically all "vertex functors" ( the functors which accept
`const LHCb::VertexBase*`

as arguments) have their names starting from`V`

, the most evident exception if the functor`PRIMARY`

- All indices, e.g. for
`CHILDCUT`

or`CHILDFUN`

functors, starts from`1`

.`0`

always means the particle itself. - For many Particle functors there is an equivalent Particle array functor starting with an
`A`

. A notable exception is`ADAMASS`

for`ADMASS`

.

`ALL`

: All FilterDesktop.Filter.Code ="ALL"

`ABSID`

: Absolute value of PID. FilterDesktop.Filter.Code =Note the last line! The comparison"ABSID==211"FilterDesktop.Filter.Code ="ABSID=='pi+' "FilterDesktop.Filter.Code ="ABSID=='pi-' "

`(ABSID=='pi-')`

takes the absolute value on
The pid can also be used without the absolute value. See `ID`

.

`ACHILD`

: Compute a function on a particle in an array The functor ACHILD acts as "meta-functor", it gets the daughter particle number "N" (the second parameter of constructor), apply the functor (the first parameter of contructor) and return the result.

e.g. ACHILD(PT,1) return the transverse momentum of the first particle in the combination, ACHILD(PT,2) return the transverse momentum of the second particle in the combination.

For example:

XXX.CombinationCut ="ACHILD(PT,1)*ACHILD(PT,2)>1500000"

See the function AMAXCHILD or AMINCHILD, to get the daughter particle by name.

`ADMASS`

: The absolute mass difference to the reference value FilterDesktop.Filter.Code ="ADMASS('KS0')<50*MeV"

The mass difference can also be used without the absolute value. See `DMASS`

.

`ADPDGM`

and `ADPDGMASS`

: The absolute mass difference to the nominal mass ParticlePropertySvc

at very call and is therefore slow`ADMASS('B0')`

rather than `ADPDGM`

if you know the PID.

`AMAXCHILD or AMINCHILD`

: cut an array and return the max/min value of a functor. e.g. the minimal PT for all negative kaons: AMINCHILD(PT,"K-"==ID)

XXX.CombinationCut ="AMINCHILD(PT,"K-"==ID)*ACHILD(PT,"K+"==ID)>1500000"

This is computationally expensive, using ACHILD is much quicker if possible.

`BPVDIRA`

: Direction angle CombineParticles.MotherCut ="BPVDIRA()>0.9999"

`BPVIPCHI2()`

: IP on related PV CombineParticles.MotherCut ="BPVIPCHI2()<25"

`BPVLTFITCHI2`

: the of the proper lifetime fit. `ILifetimeFitter`

tool. This
is probably the best measure of the consistency of the hypothesis that the particle
originates from the given primary vertex. It is also probably the best "pointing" variable.
CombineParticles.MotherCut =The related primary vertex is extracted from the desktop, the fitter itself is extracted using"BPVLTFITCHI2()<16"

`DVAlgorithm::lifetimeFitter("nick-name")`

.
Please note that it is completely different functor from `BPVLTCHI2`

!

`BPVLTIME`

: the proper lifetime of the particle `ILifetimeFitter`

tool.
Unfortunately due to very sad conventions adopted for LHCb, the proper time is measured in
`ns`

instead of the natural units: .
CombineParticles.MotherCut =The related primary vertex is extracted from the desktop, the fitter itself is extracted using"BPVLTIME()>1.5"

`DVAlgorithm::lifetimeFitter("nick-name")`

.

`BPVLTCHI2`

: the -significance of the proper lifetime of the particle `ILifetimeFitter`

tool.
CombineParticles.MotherCut =The related primary vertex is extracted from the desktop, the fitter itself is extracted using"BPVLTCHI2()>9"

`DVAlgorithm::lifetimeFitter("nick-name")`

.
Please note that it is completely different functor from `BPVLTFITCHI2`

!

`BPVLTSIGNCHI2`

: the signed -significance of the proper lifetime of the particle `ILifetimeFitter`

tool.
CombineParticles.MotherCut =The related primary vertex is extracted from the desktop, the fitter itself is extracted using"BPVLTSIGNCHI2()>-4"

`DVAlgorithm::lifetimeFitter("nick-name")`

.

`BPVVDCHI2`

: -separation from related PV CombineParticles.MotherCut ="BPVVDCHI2()>100"

`BPVVDZ`

: -distance from the end vertex of the particle and the related primary vertex. CombineParticles.MotherCut =The concept and the name come from Sean Brisbane. The functor is available starting from Phys/LoKiPhys version >= v7r2."0<BPVVDZ"

`BPVVDR`

: -distance from the end vertex of the particle and the related primary vertex. CombineParticles.MotherCut =The concept and the name come from Sean Brisbane. The functor is available starting from Phys/LoKiPhys version >= v7r2."0.1<BPVVDR"

`BPVVDRHO`

: -distance from the end vertex of the particle and the related primary vertex. CombineParticles.MotherCut =The concept and the name come from Sean Brisbane. The functor is available starting from Phys/LoKiPhys version >= v7r2."0.1<BPVVDRHO"

`CHI2PDGM`

and `CHI2PDGMASS`

: The mass difference to the nominal mass in units of chi2 ParticlePropertySvc

at very call and is therefore slow`CHI2M('B0')`

rather than `CHI2PDGM`

if you know the PID.

`CHI2M`

and `CHI2MASS`

: The mass difference to some reference mass in units of chi2 `ADMASS`

CombineParticles.MotherCut ="CHI2M('B0')<5"

`CHILDCUT`

: Applies a cut to a given child FilterDesktop.Filter.Code =In this example one applies an IP cut on the"CHILDCUT ( MIPCHI2DV ( PRIMARY ) > 1 , 1 )"

`(N)INTREE`

won't work. Like here for the slow pion in a where searching for a pion in the tree would also return the daughters of the . Use the safer `INTREE`

and `NINTREE`

instead.
**TODO** : Is there a way of applying a cut to the daughters only, without navigating the whole tree? From next version `NINGENERATION`

and `INGENERATION`

will do this.

`DECTREE`

: Check if a particle satisfies a certain decay descriptor FilterDesktop.Filter.Code =The example selects the decay of B0 to D- pi+ followed by D- to K+ pi- pi-. This can be useful for example to select one or more decay channels from a stripping line that contains many decay channels"DECTREE ('B0 -> (D- -> K+ pi- pi-) pi+')"

`DMASS`

: The mass difference to the reference value `ADMASS`

) or the mass itself (see `MM`

).

`DPDGM`

and `DPDGMASS`

: The mass difference to the nominal mass ParticlePropertySvc

at very call and is therefore slow`DMASS('B0')`

rather than `DPDGM`

if you know the PID.

`ID`

: Particle ID `ABSID`

but without the absolute value.

`INGENERATION`

: "in generation" FilterDesktop.Code =Requires the presence of at least one granddaughter , which the transverse momentum . The generations are defined as: 0 - the particle itself, 1 - the direct children, 2 - grandchildren , etc. The concept and the name come from Patrick Koppenburg. The functor is available starting from Phys/LoKiPhys version >= v7r2."INGENERATION ( ( 'mu+'==ABSID) & ( PT > 2 * GeV ) , 2 ) "

`INTREE`

: In tree FilterDesktop.Filter.Code =Requires there is a in the tree more than away from the best vertex."INTREE( (ID=='J/psi(1S)') & (BPVVDCHI2>25) ) "

`MAXTREE`

: Maximum value in the decay tree CombineParticles.MotherCut =This example looks for all in the decay, returns the largest mass (which is the mass of the as there's only one) and computes the mass difference with the mother."M-MAXTREE('D0'==ABSID,M)<165.5"

`MINTREE`

: Minimal value in the decay tree FilterDesktop.Filter.Code =This would look for all particles kaons in the decay tree and find their and return the minimum. The cut then requires that all kaon descendents have a ."MINTREE(ABSID=='K+',PT)>1400*MeV"

`MINVDDV`

: minimum distance between the particle's end-vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."MINVDDV(PRIMARY)>1"

`MINVDSOURCE`

: minimum distance between the particle's end-vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."MINVDSOURCE( VSOURCEDV ( PRIMARY ) )>1"

`MINVDTES`

: minimum distance between the particle's end-vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."MINVDTES('SomeLocationInTES',PRIMARY)>1"

`MIPCHI2DV`

: Minimum IP- `PRIMARY`

argument that looks at PVs.
FilterDesktop.Filter.Code =This requires that the particle is away from any PV."MIPCHI2DV(PRIMARY)>9"FilterDesktop.Filter.Code ="MIPCHI2DV()>9"## ditto

`MIPDV`

: Minimum IP `PRIMARY`

argument that looks at PVs.
FilterDesktop.Filter.Code =This requires that the particle is 0.15 mm away from any PV."MIPDV(PRIMARY)>0.15"

`M`

: Mass `LHCb::Particle::momentum().M()`

. For many cases it should be practically the same as `MM`

.

`MM`

: Measured Mass `LHCb::Particle::measuredMass()`

is used for evaluation.
HltSharedDiMuon.CombinationCuts =This selects dimuons up to a mass of 11 GeV."AM<11*GeV"

`NINGENERATION`

: "Number of particles in generation" FilterDesktop.Filter.Code =Requires the presence of exactly two granddaughter with the transverse momentum . The generations are defined as: 0 - the particle itself, 1 - the direct children, 2 - grandchildren , etc. The concept and the name come from Patrick Koppenburg. The functor is available starting from Phys/LoKiPhys version >= v7r2." 2 == NINGENERATION ( ( 'mu+'==ABSID) & ( PT > 2 * GeV ) , 2 ) "

`NINTREE`

: Number of particles in tree FilterDesktop.Filter.Code =Requires that there are two electrons in the tree with ."2 == NINTREE( (ABSID=='e-') & (PT>1*GeV))"

`NMASS`

: The nominal mass of a particle ParticlePropertySvc

at very call and is therefore slow`ADMASS('B0')`

rather than `abs(MM-NMASS)`

if you know the PID.

`P`

: Momentum FilterDesktop.Filter.Code =Gets particles with ."P>2*GeV"

`PIDe`

, `PIDmu`

, `PIDK`

, `PIDp`

, `PIDpi`

: PID FilterDesktop.Filter.Code ="PIDe-PIDpi>6"

`PT`

: Transverse momentum FilterDesktop.Filter.Code =Gets particles with ."PT>1*GeV"

`TRCHI2`

: the track fit FilterDesktop.Filter.Code ="TRCHI2<1000"

`TRCHI2DOF`

: per degree of freedom of the track fit FilterDesktop.Filter.Code ="TRCHI2DOF<20"

`TRPCHI2`

: -probability the track fit FilterDesktop.Filter.Code ="TRPCHI2>0.01"

`VDMIN`

: Distance of two vertices

`VFASPF`

: Vertex Function as Particle Function. `endVertex()`

.
CombineParticles.MotherCut =Applies a cut to the vertex of the particle."VFASPF(VCHI2/VDOF)<10"

`AHASCHILD`

: Checks if there is a particle in the array that matches the requirements CombineParticles.CombinationCut =Requires there's at least one pion with a Pt larger than 1 GeV in the combination. This is useful when one requires at least one particle in the decay to meet a requirement."AHASCHILD((ABSID=='pi+') & (PT>1*GeV))"

`ADAMASS`

: The absolute mass difference to the PDG reference value CombineParticles.CombinationCut ="ADAMASS('KS0')<50*MeV"

`AM`

: Mass of the combination

`AMAXCHILD`

, `AMINCHILD`

: Maximal, minimal value in array. CombineParticles.CombinationCut =In this example one checks that the minimal PT of pions in the decay tree of the particles is in excess of 1 GeV."1*GeV<AMINCHILD(MINTREE('pi-'==ABSID,PT)"

`AMAXDOCA`

, `AMINDOCA`

: Distance of closest approach cut CombineParticles.CombinationCut =Checks that the maximum distance of closest approach between all possible pairs of particles is less than 80mum. Equal results can be otained with less CPU time using"(AMAXDOCA('') < 0.08*mm)"

CombineParticles.CombinationCut ="ACUTDOCA(0.08*mm,'')"

`AMAXDOCACHI2`

, `AMINDOCACHI2`

: Distance of closest approach significance cut CombineParticles.CombinationCut =Checks that the maximum distance of closest approach - chi2 between all possible pairs of particles is less than 10. Equal results can be otained with less CPU time using"(AMAXDOCACHI2('') < 10)"

CombineParticles.CombinationCut =This cut is particularly useful to gain speed on vertex fits. As a rule of thumb, any vertex chi2 cut can be preceded by a DOCACHI2 cut at the same (total, not reduced!) chi2."ACUTDOCACHI2(10,'')"

`ANUM`

: Number of particles in the array meeting a requirement CombineParticles.CombinationCut ="1<ANUM( ('pi+'==ABSID) & (MIPCHI2DV(PRIMARY)>25))"

`AP`

: Sum momentum of the array CombineParticles.CombinationCut =Gets particles with ."AP>1*GeV"

`APT`

: Sum transverse momentum of the array CombineParticles.CombinationCut =Gets particles with ."APT>1*GeV"

`VFASPF`

.

`VX`

, `VY`

, `VZ`

: Vertex x, y or z-position CombineParticles.MotherCut ="VFASPF(VZ)>-100 & VFASPF(VZ)>100"

`VCHI2`

: Vertex CombineParticles.MotherCut ="VFASPF(VCHI2/VDOF)<10"

`VDOF`

: Vertex fit number of degrees of freedom CombineParticles.MotherCut =A two-track vertex has one degree of freedom. A three-track vertex has three degrees of freedom."VFASPF(VCHI2/VDOF)<10"

`VMINVDDV`

: minimum distance between the vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."VFASFP(VMINVDDV(PRIMARY))>1"

`VMINVDSOURCE`

: minimum distance between the vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."VFASPF( VMINVDSOURCE( VSOURCEDV ( PRIMARY ) ) ) >1"

`VMINVDTES`

: minimum distance between the vertex and any other vertex CombineParticles.MotherCut =Requires that the particle's end-vertex has at least one millimeter separation with respect to any primary vertex."VFASPF( VMINVDTES ( 'SomeLocationInTES' , PRIMARY ) ) >1"

`VPCHI2`

: -probability `gsl_cdf_chisq_Q`

functon is used for evaluation.
CombineParticles.MotherCut =The functor is available starting from Phys/LoKiPhys version >= v7r2"VFASPF(VPCHI2)>1*perCent"

`M`

(mass) and `m`

(meter) for instance a limited set will be defined. Vanya suggests:

- MeV, GeV
- mm, millimeter, cm , centimeter, meter
- perCent
- ns, fs, nanosecond, femtosecond, ps, picoseconds

`&`

and `|`

operators, not boolean operators. This also requires that cuts are well protected using parentheses. Example:
FilterDesktop.Filter.Code =Cuts can be split over several lines."( ((ABSID=='pi+') & (PT>400*MeV)) | ((ABSID=='KS0') & (PT>1*GeV)))"

Some allowed symbols are instances, therefore they do not require any parentheses, e.g. P, PT etc...
Some symbols are **types**, e.g. `MIPDV`

, and they require to be instantiated.
The parentheses means invocation of constructor.
E.g. `MIPDV(PRIMARY)`

is just invocation of the constructor of **type** `MIPDV`

with parameter `PRIMARY`

(the predicate to select the vertices).
the simplest way to check if
the symbol is a type or instance is through inspection using the
interactive python:

[lxplus097] ~/cmtuser/DaVinci_v19r12/Phys/DaVinci/v19r12/cmt % python Python 2.5 (r25:51908, Oct 18 2007, 16:04:48) [GCC 3.4.6 20060404 (Red Hat 3.4.6-8)] on linux2 Type"help","copyright","credits"or"license"formore information. >>>fromLoKiPhys.decoratorsimport* >>>fromLoKiArrayFunctors.decoratorsimport* >>>P P >>>MIPDV <class'LoKiPhys.functions.LoKi::Particles::MinImpParDV'>

`CombineParticles`

. `CombineParticles`

is a `LoKI::Algo`

, and a `DVAlgorithm`

that combines the input particles according to the decay descriptor. There are three cuts applied :

`DaughtersCuts`

: `"particle" : "cuts"`

HltSelB2DstarMu.DaughtersCuts = { // PT cutformuons"mu-":"PT>400*MeV", // IP_chi2 cutforD0inD*+"D*(2010)+'":"MAXTREE('D0'==ABSID,BPVVDCHI2) >6.25 "}

`CombinationCut`

`A`

.

`MotherCut`

`MotherCut`

, while the others can be applied earlier (saving CPU). Note that for long lived particles like Ks it pays off to apply a loose mass cut in `CombinationCut`

and a harder in `MotherCut`

. The reason is that the vertex fit does a propagation of the momenta through the detector. You thus get the momentum at the Ks vertex, while in `CombinationCut`

it's just the sum of the momenta of the daughters at their first measurement.
A simple example:

HltShared.Members += {"CombineParticles/HltSharedPhi2KK"} HltSharedPhi2KK.PhysDesktop.InputLocations = {"Phys/HltNoPIDsKaons"} HltSharedPhi2KK.DecayDescriptor ="phi(1020) -> K+ K-"// (IP > 2 sigma^2) HltSharedPhi2KK.DaughtersCuts = {"K+":"MIPCHI2DV(PRIMARY)>4"} // mass window +/- 300 MeV HltSharedPhi2KK.CombinationCut ="ADAMASS('phi(1020)')<50"// chi2/ degrees of freedom < 25 HltSharedPhi2KK.MotherCut ="VFASPF(VCHI2/VDOF)<25"

The decay descriptor can be overwritten by `DecayDescriptors`

which allows to reconstruct several decays in one go.

HltShared.Members += {"CombineParticles/HltSharedDstarWithD02KPi"} HltSharedDstarWithD02KPi.PhysDesktop.InputLocations = {"Phys/HltSharedD02KPi","Phys/HltSharedSlowPions"} // also wrong-sign ones HltSharedDstarWithD02KPi.DecayDescriptors = {"[D*(2010)+ -> pi+ D0]cc","[D*(2010)+ -> pi+ D~0]cc"} // mass window +/- 50 MeV, PT> 1.25 GeV HltSharedDstarWithD02KPi.CombinationCut ="(ADAMASS('D*(2010)+')<50) & (APT>1250)"// Chi2/nDoF < 25 . m(D*-D0) = 145.5 MeV, +2 HltSharedDstarWithD02KPi.MotherCut ="(VFASPF(VCHI2/VDOF)<25) & (M-MAXTREE('D0'==ABSID,M)<165.5)"

Each cut, which is applicable to mother is also applicable to
daughter (and vice versa).
Moreover the cut, used for daughter particle, being equipped with the
proper `CHILD,CHILDFUN,CHILDCUT,MINTREE,MAXTREE,INTREE,NINTREE`

meta-
function, gives **IDENTICAL** result being applied for
the mother particle.

From pure C++ point of view, both `DaughterCuts`

and `MotherCuts`

are objects which get as argument `const LHCb::Particle*`

. But
`CombinationCut`

accepts as an argument
`LoKi::Range_<LHCb::Particle::ConstVector>"`

.

Therefore is requires the DIFFERENT objects.
`CombinationCut`

is applied for the combination of "good" daughter
particles, and only for the combinations, which satisfy
`CombinationCut`

, the effective mother particle is created through
teh vertex fit procedure, and `MotherCut`

is applied for this effective mother particle.

`lhcb-davinci@cern.ch`

, `lhcb-loki@cern.ch`

, `lhcb-bender@cern.ch`

In this case more colleagues can profit from solutions to the problems and it will allow a bit more wide distribution of useful information, tricks, recipes, experience and the solutions. Also it will simplify the monitoring of the progress with the implementation of the missing functionality. As alternative to the mailing lists the following actions are also accepted:

- One can submit the question to LoKi FAQ.
- One can submit new task or request new feature through Savannah LoKi portal
- One can submit new task or request new feature through Savannah Bender portal

`Hlt/HltSelections`

package from version `v6r0`

released with `DaVinci v19r11`

.

Suggestions for the names of the filters in `CombineParticles`

are also welcome.

`LoKi::Hybrid`

construction.

`LoKi::Hybrid::PrintTool`

The most primitive tool, it implements the abstract interface
`IPrintDecay`

,
and it allows to print some information about the decay tree.
It is convinient to use the high-level algorithm `PrintDecayTree`

to drive the tool:

// append the algorithm to the list of top level algorithms:ApplicationMgr.TopAlg += {"PrintDecayTree/Printer"} ;// declare the actual type/name of the IPrintDecay tool:Printer.PrintDecayTool ="LoKi::Hybrid::PrintTool/PRINT";// declare the variables to be printed by the tool, each "variable" is just LoKi-functor:Printer.PRINT.Variables = {"ID","P/GeV","PT/GeV","M/GeV","KEY"} ;

With this configuration one obtains the following printout:

Printer.PRINT INFO Print the decay tree: ( B0 -> mu+ mu- K+ K- ) --------------------------------------------------------------------------------------------------------- |# Decay | ID | (P/1000) | (PT/1000) | M | KEY | --------------------------------------------------------------------------------------------------------- |0 |--> B0 | 511 | 262.81 | 6.1192 | 5099.1 | 5 | |1 |--> mu+ | -13 | 56.877 | 1.6668 | 105.66 | 0 | |1 |--> mu- | 13 | 128.8 | 3.7141 | 105.66 | 1 | |1 |--> K+ | 321 | 56.877 | 1.6668 | 493.68 | 2 | |1 |--> K- | -321 | 20.261 | 0.63129 | 493.68 | 5 | ---------------------------------------------------------------------------------------------------------For the default configuration, all columns are printed using

`14.5g`

"scientific" format and the column title is
constructed from the functor itself. However both the format and the table header could be modified,
e.g. if one adds into the previous configuration the explicit specification of `Format`

and `Header`

:
// Format:In this case the output table looks like:and1st (ID) variablefromthe list of"Variables": Printer.PRINT.Format ="| %5% %|6t|| %1% %|14t||"// specify explicitly the table header: column names Printer.PRINT.Header ="| Key | PdgID |"

Printer.PRINT INFO Print the decay tree: ( B0 -> mu+ mu- K+ K- ) --------------------------------------- |# Decay | Key | PdgID | --------------------------------------- |0 |--> B0 | 5 | 511 | |1 |--> mu+ | 0 | -13 | |1 |--> mu- | 1 | 13 | |1 |--> K+ | 2 | 321 | |1 |--> K- | 5 | -321 | ---------------------------------------

For more details see the Doxygen documentation here.

`LoKi::Hybrid::PlotTool`

The simple tool, which implements the abstract interface `IPlotTool`

and allows to fill some histograms for the selected particles.

For more details see the Doxygen documentation here.

`LoKi::Hybrid::TupleTool`

The tool is a specialization of general "tuple tools", the concept developed by Jeremie Borel. The usage is failrly trivial:

ApplicationMgr.TopAlg += {"DecayTreeTuple/MyDecayTreeTuple"} ;// specify location of input data in TESMyDecayTreeTuple.PhysDesktop.InputLocations = {"Phys/HltSelBd2MuMuKstar"} ;// use various tools, developed by JeremieMyDecayTreeTuple.ToolList = {"TupleToolTrigger","TupleToolMCTruth","TupleToolMCBackgroundInfo","TupleToolGeometry","TupleToolKinematic","TupleToolPropertime","TupleToolPrimaries","TupleToolEventInfo"// use also LoKi-based Tuple Tool!!,"LoKi::Hybrid::TupleTool/LoKiTool"/// < THIS LINE};// configure LoKi tuple tool:MyDecayTreeTuple.LoKiTool.Variables = {"mass":"M/GeV","p":"P/GeV","pt":"PT/GeV"};

For this example, the tool adds three columns into N-Tuple, defines the names of the column to be
`"head"+"mass"`

, `"head"+"p"`

and `"head"+"pt"`

.
The content of the colums will be filled with tresult of evaluation of the following LoKi functors:

, **M/GeV**

and **P/GeV**

.
**PT/GeV**

For more details see the Doxygen documentation here.

Sometime for debugging purposes the direct manipulation with factories could be useful. Also it could have some sense for validation of functors and comparison with some other calculations.

Since the factory is

in Gaudi sense, first one needs to acquire the factory
**AlgTool**

#include"LoKi/IHybridFactory.h"...conststd::string factoryName ="LoKi::Hybrid::Tool/HybridFactory:PUBLIC"; LoKi::IHybridFactory* factory = tool<LoKi::IHybridFactory> ( factoryName ) ;

And now one can use the factory for creation of of functors (functions and predicates) :

using namespace LoKi::Types ; using namespace LoKi::Cuts ;In a similar way one can create predicate (the functor with returns// initialize the function with *some* valuesFun fun = -1.E+10 * ONE ;// get the codeconststd::string& code = .... ;// instantiate the functor:StatusCode sc = factory->get ( code , fun ) ;if( sc.isFailure() ) { .... }// handle the error

**bool**

):

using namespace LoKi::Types ; using namespace LoKi::Cuts ;// initialize the predicate with *some* valuesCut cut = NONE ;// get the codeconststd::string& code = .... ;// instantiate the functor:StatusCode sc = factory->get ( code , cut ) ;if( sc.isFailure() ) { .... }// handle the error

Finally one can operate with

and **fun**

objects as with regular LoKi functors.
**cut**

The complete example is available here.

-- PatrickKoppenburg - 28 Mar 2008 -- PatrickKoppenburg - 25 Apr 2008 -- Karol Hennessy - 15 May 2008 -- Vanya Belyaev - 12 Jun 2008 -- PatrickKoppenburg - 18 Aug 2008

This topic: LHCb > WebHome > LHCbComputing > DaVinci > LoKiHybridFilters

Topic revision: r39 - 2019-08-02 - NiklasStefanNolte

Copyright &© 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.

or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback

or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback