 # LoKi's Particle Functions

This lists a lot of the LoKi Functors. See DaVinciTutorial4 for a hands-on tutorial. A list with examples of use in `CombineParticles` can be found at LoKiHybridFilters. As neither are guaranteed to be a complete list, you can always see the DOxygen for the `LoKi::Cuts` namespace here .

### `ALL`, C++: the instance of `LoKi::BooleanConstant<const LHCb::Particle*>(true)`

The most trivial "select-all" predicate which always returns `true`

### `ABSID`, the instance of `LoKi::Particles::AbsIdentifier()`

The simple function which returns the absolute value of PDG-identifier of the particle:
``` 1000const LHCb::Particle* p = ... ;
1010const double absid = ABSID( p ) ;```
The special equality/non-equality operators against `std::string` and `LHCb::ParticleID` objects are defined:
``` 1000Range kaons = select ( "kaons" , "K+" == ABSID ) ;
1010Range nonmuons = select ( "!mu" , LHCb::ParticleID( 13 ) != ABSID ) ;```
See also ID.

### `ADMASS`, C++ type `LoKi::Particles::AbsDeltaMass`

The simple function which returns the absolute value of the deviation of the particle's mass from some reference value or the nominal mass:
``` 1000const LHCb::Particle* d0 = ... ;
1010Fun dm = ADMASS ( 1.864 * GeV ) ; ///< constructor from the reference mass
1020const double delta = dm ( d0 ) ; ///< evaluate abs(mass - 1.864 * GeV)
1030```
The function could be used with various constructors:
``` 1000const LHCb::Particle*       particle = ... ; // get the particle
1010IParticlePropertySvc* ppsvc    = ... ; // get the service
1020const ParticleProperty& D0     = ... ; // get from the service
1030
1040Fun dm1 = ADMASS ( "D0" , ppsvc ) ; ///< constructor form the name and Service
1050const double    dm1       = dm1 ( particle ) ;
1060Fun dm2 = ADMASS ( 241  , ppsvc ) ; ///< constructor from PID and Service
1070const double    dm2       = dm2 ( particle ) ;
1080Fun dm3 = ADMASS ( D0 ) ;   ///< constructor from ParticleProperty
1090const double    dm3       = dm3 ( particle ) ;
1100Fun dm4 = ADMASS ( "D0" ) ; ///< constructor from the name
1110const double    mm4       = dm4 ( particle ) ;
1120Fun dm5 = ADMASS ( LHCb::ParticleID ( 421 )  ) ; // constructor from PID
1130const double    mm5       = dm5 ( particle ) ;```
The later two constructors could be used only if LoKi Service, implementation of `LoKi::ILoKiSvc` insterface, is active. The function is very convinient to be used in the loops:
``` 1000Cut dm = ADMASS("phi(1020)") < 10 * MeV ; ///< create the cut
1010for ( Loop phi = loop ( "K+ K-" , "phi(1020)") ; phi ; ++phi )
1020   {
1030     if ( dm ( phi ) ) { phi -> save ( "phi" ) ; }
1040   }```
See also DMASS.

### `ADMMASS`, C++ type `LoKi::Particles::AbsDeltaMeasuredMass`

The simple function which returns the absolute value of the deviation of the particle's measured mass from some refernece value or the nominal mass:
``` 1000const LHCb::Particle* d0 = ... ;
1010Fun dm = ADMMASS ( 1.864 * GeV ) ; ///< constructor from the reference mass
1020const double delta = dm ( d0 ) ; ///< evaluate abs( measuredMass - 1.864 * GeV)
1030```
The function could be used with various constructors:
``` 1000const LHCb::Particle*       particle = ... ; // get the particle
1010IParticlePropertySvc* ppsvc    = ... ; // get the service
1020const ParticleProperty& D0     = ... ; // get from the service
1030
1040Fun dm1 = ADMMASS ( "D0" , ppsvc ) ; ///< constructor form the name and Service
1050const double    dm1       = dm1 ( particle ) ;
1060Fun dm2 = ADMMASS ( 241  , ppsvc ) ; ///< constructor from PID and Service
1070const double    dm2       = dm2 ( particle ) ;
1080Fun dm3 = ADMMASS ( D0 ) ;   ///< constructor from ParticleProperty
1090const double    dm3       = dm3 ( particle ) ;
1100Fun dm4 = ADMMASS ( "D0" ) ; ///< constructor from the name
1110const double    mm4       = dm4 ( particle ) ;
1120Fun dm5 = ADMMASS ( LHCb::ParticleID ( 421 )  ) ; // constructor from PID
1130const double    mm5       = dm5 ( particle ) ;```
The later two constructors could be used only if LoKi Service, implementation of `LoKi::ILoKiSvc` insterface, is active. See also DMMASS.

### `BASIC`

It is an alias for `ISBASIC`, see ISBASIC

### `CHILD`, C++ type `LoKi::Particles::ChildFunction`

The function which delegates the evaluation of another function to the daugher particle:
``` 1000const LHCb::Particle* B = ... ;
1010// pt of the first daughter:
1020Fun fun1 = CHILD ( PT , 1 ) ;
1030const double pt1 = fun1 ( B ) ;
1040// energy of the first daughter of the first daughter:
1050Fun fun2 = CHILD ( E , 1 , 1 ) ;
1060const double e11 = fun2 ( B ) ; ```
Note:
• The indices start from `1`

### `CHILDFUN`

It is an alias for `CHILD`, see CHILD

### `CHILDCUT`, C++ type `LoKi::Particles::ChildPredicate`

The predicate which delegates the evaluation of another predicate to the daugher particle:
``` 1000const LHCb::Particle* B = ... ;
1010// is the first daughter a pion?
1020Cut cut1 = CHILDCUT ( "pi+" == ABSID , 1 ) ;
1030const bool pion1 = cut1( B ) ; ```
Note:
• The indices start from `1`

### `CHI2M`, C++ type `LoKi::Particles::DeltaMeasuredMassChi2`

The simple function which returns the deviation of the the particle's measured mass from some refernece value or the nominal mass in units
``` 1000const LHCb::Particle* d0 = ... ;
1010Fun chi2m = CHI2M ( 1.864 * GeV ) ; ///< constructor from the reference mass
1020const double chi2  = chi2m ( d0 ) ; ///< evaluate chi2(mass - 1.864 * GeV)
1030```
The function could be used with various constructors:
``` 1000const LHCb::Particle*       particle = ... ; // get the particle
1010IParticlePropertySvc* ppsvc    = ... ; // get the service
1020const ParticleProperty& D0     = ... ; // get from the service
1030
1040Fun dm1 = CHI2M ( "D0" , ppsvc ) ; ///< constructor form the name and Service
1050const double    dm1       = dm1 ( particle ) ;
1060Fun dm2 = CHI2M ( 241  , ppsvc ) ; ///< constructor from PID and Service
1070const double    dm2       = dm2 ( particle ) ;
1080Fun dm3 = CHI2M ( D0 ) ;   ///< constructor from ParticleProperty
1090const double    dm3       = dm3 ( particle ) ;
1100Fun dm4 = CHI2M ( "D0" ) ; ///< constructor from the name
1110const double    mm4       = dm4 ( particle ) ;
1120Fun dm5 = CHI2M ( LHCb::ParticleID ( 421 )  ) ; // constructor from PID
1130const double    mm5       = dm5 ( particle ) ;```
The later two constructors could be used only if LoKi Service, the implementation of `LoKi::ILoKiSvc` insterface, is active.

### `CHI2MASS`

It is an alias for `CHI2M`, see CHI2M

### `CHI2MIP`

It is an alias for `MIPCHI2`, see MIPCHI2

### `CL`, the instance of `LoKi::Particles::ConfidenceLevel()`

The simple function which returns the confedence level of the particle:
``` 1000const LHCb::Particle* p = ... ;
1010const double cl = CL ( p ) ;```

### `CLAPP`, C++ type `LoKi::Particles::ClosestApproach`

The simple function which evaluated the distance of the closest approach between the particle and some reference particle. `IDistanceCalculator` is used for the evaluation.
``` 1000const LHCb::Particle* K = ... ;
1010// find all "close" paricles:
1020Range closest = select ( "closest" , CLAPP( K1 , geo() ) < 0.1 * mm ) ;```

### `CLAPPCHI2`, C++ type `LoKi::Particles::ClosestApproachChi2`

The simple function which evaluated the of the distance of the closest approach between the particle and some reference particle. `IDistanceCalculator` is used for the evaluation.
``` 1000const LHCb::Particle* K = ... ;
1010// find all "close" paricles:
1020Range closest = select ( "closest" , CLAPPCHI2( K1 , geo() ) < 9 ) ;```

### `CONFLEV`

It is an alias for `CL`, see CL

### `CONFLEVEL`

It is an alias for `CL`, see CL

### `COUNTER`, C++ type `LoKi::Monitoring::Counter<const LHCb::Particle*> `

The simple predicate, useful for monitoring of the another predicates. Essentially it monitors the performance (acceptance rate) of another predicate.

``` 1000// The predicate to be monitored:
1010Cut cut = ... ;
1020// the generic Counter:
1030StatEntity* counter = ...;
1040// Monitored predicate:
1050Cut mon = COUNTER( cut , counter ) ;
1060// use it!
1070for ( ... )
1080  {
1090    ...
1100    const LHCb::Particle* p = ... ;
1110    const bool result = mon ( p  ) ; ///< use the predicate!
1120    ...
1130  }
1140...
1150info ()
1160   << " The performace:  " << endreq
1170   << " # of entries       #" << counter->nEntries() << endreq
1180   << " Acceptance rate  (" << counter->eff()*100
1190   << " += "                     << counter->effErr() * 100 )
1200   << ")%"       << endreq ;
1210...```
The generic counter of C++ type `StatEntity ` could be either the local counter owned by the `GaudiAlgorithm ` or `GaudiTool ` base classes, or it could be the counter from `IStatSvc ` or `ICounterSvc ` services.

The alternative (and recommended!) way for creation of the monitored predicate is through the function `monitor`:

``` 1000// The predicate to be monitored:
1010Cut cut = ... ;
1020// the generic Counter:
1030StatEntity* counter = ...;
1040// Monitored predicate:
1050Cut mon = monitor ( cut , counter ) ;```
E.g. in the case of local counter, it could be:
``` 1000// The predicate to be monitored:
1010Cut cut = ... ;
1020// Monitored predicate:
1030Cut mon = monitor ( cut , counter("SomeEfficiencyCounter") ) ;```

The substitution of the predicate could be done on-flight without disturbing of the actual processing:

``` 1000// The regular predicate
1010Cut cut = ... ;
1020if ( monitoring )  ///< add the monitoring capabilities (if needed)
1030 {
1040    cut = monitor ( cut , counter("SomeEfficiencyCounter") ) ;
1050 }```
The string representation of the monitored predicate and the unique ID are delegated to the predicate itself, making the object non-reconstructable from its own string representation. It is done on-purpose to avoid any interference and disturbance with the regular procession.

### `CTAU`

It is an alias for `TIMEDIST`, see TIMEDIST

### `CTAUDOT`

It is an alias for `TDOT`, see TDOT

### `CTAUSIGN`

It is an alias for `TSIGND`, see TSIGND

### `DANG`

It is an alias for `DIRA`, see DIRA

### `DELTAR2`

It is an alias for `DR2`, see DR2

### `DETA`, C+ type `LoKi::Particles::DeltaEta`

The function which returns the value of for the particle's momenta with respect some reference momentum:
``` 1000const LHCb::Particle* jet = ... ;
1010Fun deta = DETA ( jet->momentum() ) ;
1020const LHCb::Particle* p = ... ;
1030const double deltaEta = deta ( p ) ;```

### `DIRA`, C++ type `LoKi::Particles::CosineDirectionAngle`

The function evaluates the coside of the angle between the momentum of the particle and the direction vector from some reference vertex or 3D-point to the end-vertex of the particle:
``` 1000const LHCb::VertexBase* primary = ... ;
1010const LHCb::Particle* B = ... ; // get the particle
1020Fun dira = DIRA ( primary ) ;
1030const double result = dira ( B ) ;```

### `DMASS`, C++ type `LoKi::Particles::DeltaMass`

The simple function which returns the deviation of the particle's mass from some refernece value or the nominal mass:
``` 1000const LHCb::Particle* d0 = ... ;
1010Fun dm = DMASS ( 1.864 * GeV ) ; ///< constructor from the reference mass
1020const double delta = dm ( d0 ) ; ///< evaluate (mass - 1.864 * GeV)
1030```
The function could be used with various constructors:
``` 1000const LHCb::Particle*       particle = ... ; // get the particle
1010IParticlePropertySvc* ppsvc    = ... ; // get the service
1020const ParticleProperty& D0     = ... ; // get from the service
1030
1040Fun dm1 = DMASS ( "D0" , ppsvc ) ; ///< constructor form the name and Service
1050const double    dm1       = dm1 ( particle ) ;
1060Fun dm2 = DMASS ( 241  , ppsvc ) ; ///< constructor from PID and Service
1070const double    dm2       = dm2 ( particle ) ;
1080Fun dm3 = DMASS ( D0 ) ;   ///< constructor from ParticleProperty
1090const double    dm3       = dm3 ( particle ) ;
1100Fun dm4 = DMASS ( "D0" ) ; ///< constructor from the name
1110const double    mm4       = dm4 ( particle ) ;
1120Fun dm5 = DMASS ( LHCb::ParticleID ( 421 )  ) ; // constructor from PID
1130const double    mm5       = dm5 ( particle ) ;```
The later two constructors could be used only if LoKi Service, implementation of `LoKi::ILoKiSvc` insterface, is active. See also ADMASS.

### `DMMASS`, C++ type `LoKi::Particles::DeltaMeasuredMass`

The simple function which returns the deviation of the particle's measured mass from some refernece value or the nominal mass:
``` 1000const LHCb::Particle* d0 = ... ;
1010Fun dm = DMMASS ( 1.864 * GeV ) ; ///< constructor from the reference mass
1020const double delta = dm ( d0 ) ; ///< evaluate ( measuredMass - 1.864 * GeV)
1030```
The function could be used with various constructors:
``` 1000const LHCb::Particle*       particle = ... ; // get the particle
1010IParticlePropertySvc* ppsvc    = ... ; // get the service
1020const ParticleProperty& D0     = ... ; // get from the service
1030
1040Fun dm1 = DMMASS ( "D0" , ppsvc ) ; ///< constructor form the name and Service
1050const double    dm1       = dm1 ( particle ) ;
1060Fun dm2 = DMMASS ( 241  , ppsvc ) ; ///< constructor from PID and Service
1070const double    dm2       = dm2 ( particle ) ;
1080Fun dm3 = DMMASS ( D0 ) ;   ///< constructor from ParticleProperty
1090const double    dm3       = dm3 ( particle ) ;
1100Fun dm4 = DMMASS ( "D0" ) ; ///< constructor from the name
1110const double    mm4       = dm4 ( particle ) ;
1120Fun dm5 = DMMASS ( LHCb::ParticleID ( 421 )  ) ; // constructor from PID
1130const double    mm5       = dm5 ( particle ) ;```
The later two constructors could be used only if LoKi Service, implementation of `LoKi::ILoKiSvc` insterface, is active. See also ADMMASS.

### `DPHI`, C+ type `LoKi::Particles::DeltaPhi`

The function which returns the value of for the particle's momenta with respect some reference momentum:
``` 1000const LHCb::Particle* jet = ... ;
1010Fun dphi = DPHI ( jet->momentum() ) ;
1020const LHCb::Particle* p = ... ;
1030const double deltaPhi = dphi ( p ) ;```

### `DR2`, C+ type `LoKi::Particles::DeltaR2`

The function which returns the value of for the particle's momenta with respect some reference momentum:
``` 1000const LHCb::Particle* jet = ... ;
1010Fun dr2 = DR2 ( jet->momentum() ) ;
1020const LHCb::Particle* p = ... ;
1030const double deltaR2 = dr2 ( p ) ;```

### `E`, the instance of `LoKi::Particles::Energy()`

The simple function which returns the value of the particle's energy:
` 1000Range energetic = select ( "energetic" ,  E > 10 * GeV ) ; `

### `ETA`, the instance of `LoKi::Particles::PseudoRapidity()`

The simple function which returns the pseudorapidity:
` 1000Range some = select ( "eta<4" ,  ETA < 4 ) ; `

### `EQUALTO`, C++ type `LoKi::EqualToValue<const LHCb::Particle*>`

The simple predicate which checks if the value of the certain function equal to some predefined value:
``` 1000Range k1 = select ( "positive" , EQUALTO( Q , +1.0 ) ) ;
1010Range k2 = select ( "positive" , Q == +1 ) ; ///< the same
1020```

### `FILTER`, C++ type `LoKi::Particles::Filter`,

The adapter predicate, which allows to use `IFilterCriterion` tool as LoKi predicate:
``` 1000IFilterCriterion* criterion = ... ;
1010// select particles accroding to criterion:
1020Range good = select ( "good" , FILTER ( criterion )  ) ; ///< use the tool
1030```

### `FROM`

It is an alias for `ISINTREE`, see ISINTREE

### `FROMTREE`

It is an alias for `ISINTREE`, see ISINTREE

### `HASCALOS`

It is an alias for `PPHASCALOS`, see PPHASCALOS

### `HASINFO`, C++ type `LoKi::Particles::HasInfo`

The predicate which checks the presence of the entries in "extraInfo" field of the particle:
``` 1000Range weighted = select ( "withweight" , HASINFO ( LHCb::Particle::Weight) ) ;
1010const bool good = HASKEY( p ) ;```

### `HASKEY`, the instance of `LoKi::Particles::HasKey()`

The predicate which returns `true` if the argument has the assigned key:
``` 1000const LHCb::Particle* p =  ... ;
1010const bool good = HASKEY( p ) ;```
For invalid arguments `false` is returned. See also KEY.

### `HASMUON`

It is an alias for `PPHASMUON`, see PPHASMUON

### `HASPINFO`

It is an alias for `HASINFO`, see HASINFO

### `HASPROTO`, the instance of `LoKi::Particles::HasProto()`

The predicate which check the presence of the protoparticle:
``` 1000// select the basic particles with valid protoparticle:
1010Range withProto = select ( "WithProto" , HASPROTO ) ;```

### `HASPROTOS`, C++ type `LoKi::Particles::HasProtos`

The predicate which check the presence the protoparticles from the list:
``` 1000SEQUENCE protoparticles = ... ;
1010// select only particles, which are "independent" from the protoparticles in the list
1020Range good = select ( "Good" , !HASPROTOS( protoparticles )  ) ;```

### `HASPROTOSINTREE`, C++ type `LoKi::Particles::HasProtosInTree`

The predicate which check the presence the protoparticles from the list in thedecay tree of the particles:
``` 1000SEQUENCE protoparticles = ... ;
1010// select only particles, which are "independent" from the protoparticles in the list
1020Range good = select ( "Good" , !HASPROTOSINTREE( protoparticles )  ) ;```

### `HASRICH`

It is an alias for `PPHASRICH`, see PPHASRICH

### `HASSTATE`, C++ type `LoKi::Particles::TrackHasState`

The predicate which evaluates `LHCb::Track::hasStateAt`
``` 1000// select only particles from tracks whcih has state at TT:
1010Range good = select ( "Good" , HASTRACK && HASSTATE ( LHCb::State::AtTT )  ) ;```

### `HASTRACKS`, C++ type `LoKi::Particles::HasTracks`

The predicate which check the presence the tracks from the list:
``` 1000SEQUENCE tracks = ... ;
1010// select only particles, which are "independent" from the tracks in the list
1020Range good = select ( "Good" , !HASTRACKS( tracks )  ) ;```

### `HASTRACKS`, C++ type `LoKi::Particles::HasTracks`

The predicate which check the presence the tracks from the list in the decay tree of the particle:
``` 1000SEQUENCE tracks = ... ;
1010// select only particles, which are "independent" from the tracks in the list
1020Range good = select ( "Good" , !HASTRACKSINTREE( tracks )  ) ;```

### `HASVERTEX`, the instance of `LoKi::Particles::HasVertex()`

The predicate which check the presence of the vertex:
``` 1000// select the particles with the vertex:
1010Range withVertex = select ( "WithVertex" , HASVERTEX ) ;```

### `ID`, the instance of `LoKi::Particles::Identifier()`

The simple function which returns the value of PDG-identifier of the particle:
``` 1000const LHCb::Particle* p = ... ;
1010const double id = ID( p ) ;```
The special equality/non-equality operators against `std::string` and `LHCb::ParticleID` objects are defined:
``` 1000Range kaons = select ( "kaons" , "K+" == ID ) ;
1010Range notgamma = select ( "!gamma" , LHCb::ParticleID( 22 ) != ID ) ;```
For the invalid argument `LoKi::Constanst::InvalidID` is returned. See also ABSID.

### `INFO`, C++ type `LoKi::Particles::Info`

The function which extract "extra" information using `LHCb::Particle::info(...)` method:
``` 1000const LHCb::Particle* p =  ... ;
1010const int index = ... ;
1020Fun info = INFO( index , -1000.0 ) ;
1030const double result = info ( p ) ;```

### `INTES`, C++ type `LoKi::Particles::InTES`

The predicate which checks the certain the location of particle in Transient Event Store. It is useful to separate the input particles from the different TES locations:
` 1000Range noPID = select ( "NoPID" , INTES("NoPID", false) ) ;`
The second argument switch on/off the match of the full TES path. The leading `"/Event/"` could be always omitted.

### `INTREE`, C++ type `LoKi::Particles::InTree`

The predicate which recursively checks the presence in the decay tree of the particle the (grand)-daughter which satisfies the specified criteria:
``` 1000const LHCb::Particle* B = ... ;
1010// check the presence of phi in the decay tree:
1020Cut good = INTREE( "phi(1020)" == ID ) ;
1030const bool hasPhiInDecay = good ( B ) ;```

### `IP`, C++ type `LoKi::Particles::ImpPar`

The function which calculates the impact parameter of the particle with respect to some vertex or 3D-point using `IDistanceCalculator` tool:
``` 1000const LHCb::VertexBase* primary = ... ;
1010// get all particles with large impact parameters:
1020Range largeIP = select ( "notFromPV" , 0.2 * mm  < IP ( primary , geo() ) ) ;```

### `IPCHI2`, C++ type `LoKi::Particles::ImpParChi2`

The function which calculates the of the impact parameter of the particle with respect to some vertex or 3D-point using `IDistanceCalculator` tool:
``` 1000const LHCb::VertexBase* primary = ... ;
1010// get all particles with large impact parameters:
1020Range largeIP = select ( "notFromPV" , 4 < IPCHI2 ( primary , geo() ) ) ;```

### `IPMIN`, C++ type `LoKi::Particles::MinImpPar`

The function which calculates the minimum value of the impact parameter of the particle with respect to some set of reference vertices or 3D-point using `IDistanceCalculator` tool:
``` 1000SEQUENCE primaries = ... ;
1010// get all particles with large impact parameters:
1020Range largeIP = select ( "notFromPV" , 0.2 * mm  < IPMIN ( primaries , geo() ) ) ;```

### `IS`, C++ type `LoKi::Particles::IsAParticle`

The predicate which checks if th eparticle is contained in other list:
``` 1000SEQUENCE particles = ... ;
1010// get the particle not from the list
1020Range notFromList = select ( "notFromList" , !IS( particles ) ) ;```

### `ISBASIC`, the instance of `LoKi::Particles::IsBasic()`

The predicate which checks if the particle is a basic particle, `LHCb::Particle::isBasic`:
` 1000Range basic = select ( "basic" , ISBASIC ) ;`

### `ISDOWN`, the instance of `EQUALTO(TRTYPE,LHCb::Track::Downstream)`

The predicate which checks the type of underlying track:
``` 1000// get the particles from downstream tracks
1010Range down = select ( "Down" , HASTRACK && ISDOWN  ) ;```

### `ISINTREE`, C++ type `LoKi::Particles::IsAParticle`

The predicate which checks if the particle or any of its daughters in the list:
``` 1000SEQUENCE particles = ... ;
1010// get the particle not from the list
1020Range notFromList = select ( "notFromList" , !ISINTREE ( particles ) ) ;```

### `ISLONG`, the instance of `EQUALTO(TRTYPE,LHCb::Track::Long)`

The predicate which checks the type of underlying track:
``` 1000// get the particles from long track
1010Range longs = select ( "Long" , HASTRACK && ISLONG  ) ;```

### `ISMUON`, the instance of `LoKi::Particles::IsMuon()`

The predicate which checks `LHCb::MuonPID::isMuon`:
` 1000Range isMuon = select ( "isMuon" , ISBASIC && ISMUON ) ;`

### `ISTTRACK`, the instance of `EQUALTO(TRTYPE,LHCb::Track::Ttrack)`

The predicate which checks the type of underlying track:
``` 1000// get the particles from T-tracks
1010Range ts = select ( "T" , HASTRACK && ISTTRACK  ) ;```

### `ISUP`, the instance of `EQUALTO(TRTYPE,LHCb::Track::Upstream)`

The predicate which checks the type of underlying track:
``` 1000// get the particles from upstream tracks
1010Range ups = select ( "Up" , HASTRACK && ISUP  ) ;```

### `KEY`, the instance of `LoKi::Particles::Key()`

The function which returns the value of the assigned key.
``` 1000const LHCb::Particle* p =  ... ;
1010const double key = KEY( p ) ;```
For invalid arguments, of if no key is assigned `LoKi::Constants::InvalidKey` is returned. See also HASKEY

### `LV0`, C++ type `LoKi::Particles::DecayAngle`,

The function evaluated the cosine of the angle between the daughters's momentum and the mother flight direction in the rest system of the mother particle. For two-body decays it is just a polarization angle of the mother particle:
``` 1000const LHCb::Particle* p =  ... ;
1010Fun fun = LV0(1) ; // the dacy angle of the first daughte
1020const double result = fun ( B ) ;```
Note:
• The name comes from KAL language
• The indices start from `1`

### `LV01`, the instance of `LoKi::Particles::DecayAngle(1)`,

The function evaluated the cosine of the angle between the first daughters's momentum and the mother flight direction in the rest system of the mother particle.
``` 1000const LHCb::Particle* p =  ... ;
1010const double result = LV01 ( B ) ;```
The name comes from KAL language. See LV0

### `LV02`, the instance of `LoKi::Particles::DecayAngle(2)`,

The function evaluated the cosine of the angle between the second daughters's momentum and the mother flight direction in the rest system of the mother particle.
``` 1000const LHCb::Particle* p =  ... ;
1010const double result = LV02 ( B ) ;```
The name comes from KAL language. See LV0

### `LV03`, the instance of `LoKi::Particles::DecayAngle(3)`,

The function evaluated the cosine of the angle between the third daughters's momentum and the mother flight direction in the rest system of the mother particle.
``` 1000const LHCb::Particle* p =  ... ;
1010const double result = LV03 ( B ) ;```
The name comes from KAL language. See LV0

### `LV04`, the instance of `LoKi::Particles::DecayAngle(4)`,

The function evaluated the cosine of the angle between the fourth daughters's momentum and the mother flight direction in the rest system of the mother particle.
``` 1000const LHCb::Particle* p =  ... ;
1010const double result = LV04 ( B ) ;```
The name comes from KAL language. See LV0

### `M`, the instance of type `LoKi::Particles::Mass()`

The simple function which returns the kinematical mass of the particle , using `Gaudi::LorentzVector::Mass` method:
``` 1000const LHCb::Particle* p = ... ;
1010const double mass = M( p ) ;  ```

### `MASS`, C++ type `LoKi::Particles::InvariantMass`

The simple function which returns the invariant mass of the subcombinations of daughter particles.
``` 1000const LHCb::Particle* p = ... ;
1010Fun m12 = MASS(1,2) ; ///< the invariant mass of the first and the second daughter particles
1020const double mass  = m12( p )  ;  ```
Note:
• the indices for daughter particles start from `1`
• index `0` corresponds to the mother particle itself

### `MAXTREE`, C++ type `LoKi::Particles::MaxTree`

The function with scans the decay tree and return the maximal value of another function, evaluated for the (grand)daughter particles which satisfy the certain criteria
``` 1000const LHCb::Particle* B = ... ;
1010// maximal deviation from nominal mass for all phis in the tree:
1020Fun fun = MAXTREE ( ADMASS("phi(1020)") , "phi(1020)" == ID , -1 ) ;
1030const double maxDM = fun ( B ) ;```

### `MM`, the instance of `LoKi::Particles::MeasuredMass()`

The simple function which returns the measured mass of the particle, using `LHCb::Particle::measuredMass` method:
``` 1000const LHCb::Particle* p = ... ;
1010const double measuredMass = MM( p ) ;  ```

### `MINCLAPP`, C++ type `LoKi::Particles::MinClosestApproach`

The simple function which returns the minimum of the closest approached of the particle against some set of other particles. `IDistanceCalculator` is used for evaluation.
``` 1000SEQUENCE particles = ... ;
1010Fun fun = MINCLAPP( particles, geo() ) ;
1020const LHCb::Particle* p = ... ;
1030const double minDOCA = fun ( p ) ;  ```

### `MINCLAPPCHI2`, C++ type `LoKi::Particles::MinClosestApproachChi2`

The simple function which returns the minimum of the closest approached of the particle against some set of other particles. `IDistanceCalculator` is used for evaluation.
``` 1000SEQUENCE particles = ... ;
1010Fun fun = MINCLAPPCHI2( particles, geo() ) ;
1020const LHCb::Particle* p = ... ;
1030const double minDOCAchi2 = fun ( p ) ;  ```

### `MINIP`

It is an alias for `IPMIN`, see IPMIN

### `MINTREE`, C++ type `LoKi::Particles::MinTree`

The function with scans the decay tree and return the minimal value of another function, evaluated for the (grand)daughter particles which satisfy the certain criteria
``` 1000const LHCb::Particle* B = ... ;
1010// minimal transverse momentum of the basic particle
1020Fun fun = MINTREE ( PT , BASIC , -10 * TeV ) ;
1030const double minPT = fun ( B ) ;```

### `MINVD`

It is an alias for `VDMIN`, see VDMIN

### `MINVDCHI2`

It is an alias for `VDMINCHI2`, see VDMINCHI2

### `MIP`

It is an alias for `IPMIN`, see IPMIN

### `MIPCHI2`, C++ type `LoKi::Particles::MinImpParChi2`

The function which calculates the minimum value of the impact parameter of the particle with respect to some set of reference vertices or 3D-point using `IDistanceCalculator` tool:
``` 1000SEQUENCE primaries = ... ;
1010// get all particles with large impact parameters:
1020Range largeIP = select ( "notFromPV" , 4 < MINCHI2 ( primaries , geo() ) ) ;```

### `MULTTREE`, C++ type `LoKi::Particles::MultTree`

The function with accumulate (by multiplication) the value of another function for all daughter particles inthe decay tree, which satisfy the certain criteria
``` 1000const LHCb::Particle* B = ... ;
1010// the product of all weigth for the composed particles:
1020Fun fun = MULTTREE ( W , !BASIC , 1.0 ) ;
1030const double multW = fun ( B ) ;```

### `M12`, the instance of `LoKi::Particles::InvariantMass(1,2)`

The simple function which returns the invariant mass of the first and the second daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the first and the second daughter particles
1020const double mass  = M12( p )  ;  ```
See MASS

### `M13`, the instance of `LoKi::Particles::InvariantMass(1,3)`

The simple function which returns the invariant mass of the first and the third daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the first and the third daughter particles
1020const double mass  = M13( p )  ;  ```
See MASS

### `M14`, the instance of `LoKi::Particles::InvariantMass(1,4)`

The simple function which returns the invariant mass of the first and the fourth daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the first and the fourth daughter particles
1020const double mass  = M14( p )  ;  ```
See MASS

### `M23`, the instance of `LoKi::Particles::InvariantMass(2,3)`

The simple function which returns the invariant mass of the second and the third daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the second and the third daughter particles
1020const double mass  = M23( p )  ;  ```
See MASS

### `M24`, the instance of `LoKi::Particles::InvariantMass(2,4)`

The simple function which returns the invariant mass of the second and the fourth daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the second and the fourth daughter particles
1020const double mass  = M24( p )  ;  ```
See MASS

### `M34`, the instance of `LoKi::Particles::InvariantMass(3,4)`

The simple function which returns the invariant mass of the third and the fourth daughter particles
``` 1000const LHCb::Particle* p = ... ;
1010// the invariant mass of the third and the fourth daughter particles
1020const double mass  = M34( p )  ;  ```
See MASS

### `NDAUGS`, the instance of `LoKi::Particles::NumberOfDaughters()=`

The simple function which return number of daughter particles, `LHCb::Particle::daughters().size()`:
``` 1000/// select two body B-decays:
1010Range twobody = select ( "2" , 2 == NDAUGS ) ;```

### `NDAUGHTERS`

It is an alias for `NDAUGS`, see NDAUGS

### `NINTREE`, C++ type `LoKi::Particles::NinTree`

The function with returns the number of the (grand)daughters inthe decay tree of the particle which satisfies the specified criteria:
``` 1000const LHCb::Particle* B = ... ;
1010// select the particles with at least tho kaons in the decay tree
1020Range with2K = select ( "With2Kaons" , 1.9 < NINTREE( "K+" == ABSID ) )  ```

### `NONE`, the instance of `LoKi::BooleanConstant<const LHCb::Particle*>(false)`

The most trivial "select-none" predicate which always returns `false`

### `ONE`, the instance of `LoKi::Constant<const LHCb::Particle*>(1)`

The trivial function which always returns `1`

### `P`, the instance of type `LoKi::Particles::Momentum()`

The simple function which returns the value of the particle's momentum:
` 1000Range energetic = select ( "energetic" ,  P > 10 * GeV ) ; `

### `P2`, the instance of `LoKi::Particles::Momentum2()`

The simple function which returns the squared value of the particle's momentum:
``` 1000const LHCb::Particle* B =  ... ;
1010const double p2 = P2( B ) ;```

### `PALL`

It is an alias for `ALL`, see ALL

### `PFALSE`

It is an alias for `NONE`, see NONE

### `PHASINFO`

It is an alias for `HASINFO`, see HASINFO

### `PHI`, the instance of `LoKi::Particles::Phi()`

The simple function which returns the asimuthal angle ``` 1000const LHCb::Particle* p = ... ;
1010const double phi = PHI( p ) ;  ```

### `PIDe`, The instance of `LoKi::Particles::ProtoInfo( LHCb::ProtoParticle::CombDLLe , 0 , -1000 )`

Simple function which returns the combined identification for the electron hypothesis:
``` 1000// get all good electrons:
1010Range electrons = select ( "e" , "e+" == ABSPID && 2 < PIDe ) ;```
See PPINFO.

### `PIDmu`, The instance of `LoKi::Particles::ProtoInfo( LHCb::ProtoParticle::CombDLLmu , 0 , -1000 )`

Simple function which returns the combined identification for the muon hypothesis:
``` 1000// get all good muons:
1010Range muons = select ( "mu" , "mu+" == ABSPID && -10 < PIDmu ) ;```
See PPINFO.

### `PIDk`, The instance of `LoKi::Particles::ProtoInfo( LHCb::ProtoParticle::CombDLLk , 0 , -1000 )`

Simple function which returns the combined identification for the kaon hypothesis:
``` 1000// get all good kaons:
1010Range kaons = select ( "K" , "K+" == ABSPID && -2 < PIDK ) ;```
See PPINFO.

### `PIDp`, The instance of `LoKi::Particles::ProtoInfo( LHCb::ProtoParticle::CombDLLp , 0 , -1000 )`

Simple function which returns the combined identification for the proton hypothesis:
``` 1000// get all good protons:
1010Range protons = select ( "p" , "p+" == ABSPID && -5 < PIDp ) ;```
See PPINFO.

### `PIDpi`, The instance of `LoKi::Particles::ProtoInfo( LHCb::ProtoParticle::CombDLLpi , 0 , -1000 )`

Simple function which returns the combined identification for the pion hypothesis:
``` 1000// get all good pions:
1010Range pions = select ( "mu" , "pi+" == ABSPID && -10 < PIDpi ) ;```
See PPINFO. Note:
• according to the convention, it is set to `0`

### `PINFO`

It is an alias for `INFO`, see INFO

### `PINTES`

It is an alias for `INTES`, see INTES

### `PLOT`, C++ type `LoKi::Monitoring::Plot<const LHCb::Particle*> `

The simple function, useful for monitoring of the another function. Essentially it applies the noather function and fills the histogram with the results.

``` 1000// The function to be monitored:
1010Fun fun = ... ;
1020// the histogram
1030AIDA::IHistogramID* histo = ... ;
1040// Monitored function:
1050Fun mon = PLOT ( fun , histo ) ;
1060// use it!
1070for ( ... )
1080  {
1090    ...
1100    const LHCb::Particle* p = ... ;
1110    const double result = mon ( p  ) ; ///< use the function!
1120    ...
1130  }
1140...```

The alternative (and recommended!) way for creation of the monitored function is through the function `monitor`:

``` 1000// The function to be monitored:
1010Fun fun = ... ;
1020// the histogram
1030AIDA::IHistogramID* histo = ... ;
1040// Monitored function:
1050Fun mon = monitor ( fun , histo ) ;```

The substitution of the function could be done on-flight without disturbing of the actual processing:

``` 1000// The regular function
1010Fun fun = ... ;
1020if ( monitoring )  ///< add the monitoring capabilities (if needed)
1030 {
1040    AIDA::IHistogram1D histo = ... ;
1050    fun = monitor ( fun , histo ) ;
1060 }```
The string representation of the monitored function and the unique ID are delegated to the function itself, making the object non-reconstructable from its own string representation. It is done on-purpose to avoid any interference and disturbance with the regular procession.

### `PNONE`

It is an alias for `NONE`, see NONE

### `PONE`

It is an alias for `ONE`, see ONE

### `PPHASINFO`, C++ type `LoKi::Particles::ProtoHasInfo`

The simple predicated which checks `LHCb::ProtoParticle::hasInfo` for the underlying protoparticle:
``` 1000// get all particles where protoparticle has PhotonID infomration:
1010Range withPhotonID = select ( "Good" , BASIC && PPHASINFO( LHCb::ProtoParticle::PhotonID ) ) ;```

### `PPHASCALOS`, The instance of `LoKi::Particles::ProtoHasCaloHypos()`

The simple predicated which checks the existence of `LHCb::ProtoParticle::calos` for the underlying protoparticle:
``` 1000// get all particles where protoparticle has CaloHypo object
1010Range withCalo = select ( "Good" , BASIC && PPHASCALOS ) ;```

### `PPHASMUON`, The instance of `LoKi::Particles::ProtoHasMuonPID()`

The simple predicated which checks the existence of `LHCb::ProtoParticle::muonPID` for the underlying protoparticle:
``` 1000// get all particles where protoparticle has RichPID object
1010Range withMuonID = select ( "Good" , BASIC && PPHASMUON ) ;```

### `PPHASRICH`, The instance of `LoKi::Particles::ProtoHasRichPID()`

The simple predicated which checks the existence of `LHCb::ProtoParticle::richPID` for the underlying protoparticle:
``` 1000// get all particles where protoparticle has RichPID object
1010Range withRichID = select ( "Good" , BASIC && PPHASRICH ) ;```

### `PPINFO`, C++ type `LoKi::Particles::ProtoInfo`

The function which delegates the evaluation of `LHCb::ProtoParticle::info` for the underlying protoparticle:
``` 1000// get all particles where protoparticle has good RichPion information:
1010Range withGoodRichID = select ( "RICH" , BASIC &&  -5 < PPINFO( LHCb::ProtoParticle::RichPion , 0 , -1000 ) ) ;```

### `PROTOS`

It is an alias for `HASPROTOS`, see HASPROTOS

### `PROTOSINTREE`

It is an alias for `HASPROTOSINTREE`, see HASPROTOSINTREE

### `PSAME`

It is an alias for `SAME`, see SAME

### `PSWITCH`

It is an alias for `SWITCH`, see SWITCH

### `PT`, the instance of `LoKi::Particles::TransverseMomentum()`

The simple function which returns the particle's transverse momentum:
``` 1000const LHCb::Particle* B =  ... ;
1010const double pt = PT ( B ) ;```

--+++ `PTDIR`, C++ type `LoKi::Particles::TransverseMomentumRel` The simple function which evaluates the the particle's transverse momentum with respect to some 3D or Lorentz vector:

``` 1000const LHCb::Particle* jet =  ... ;
1010Fun pt = PTDIR ( jet->momentum() ) ;
1020const LHCb::Particle* mu = ... ;
1030const double result = pt ( mu )  ; /// evaluate pt with respect to jet axis
1040```

### `PTREL`

It is an alias for `PTDIR`, see PTDIR

### `PTRUE`

It is an alias for `ALL`, see ALL

### `PVALID`

It is an alias for `VALID`, see VALID

### `PVTRACK`, C++ type `LoKi::Particles::HasTracksFromPV`

The simple predicate which evaluates to `true` for the basic particle, which directly participate into the primary vertex recontruction:
``` 1000const LHCb::RecVertex* primary =  ... ;
1010// select only particle not used for PV recontruction:
1020Range good = select ( "Good" , BASIC && !PVTRACK( primary ) ) ;```

### `PVTRACKINTREE`, C++ type `LoKi::Particles::HasTracksFromPVInTree`

The simple predicate which evaluates to `true` for the particles which directly or indirectly participate into the primary vertex recontruction:
``` 1000const LHCb::RecVertex* primary =  ... ;
1010// select only particle not used for PV recontruction:
1020Range good = select ( "Good" , !PVTRACKINTREE ( primary ) ) ;```

### `PX`, the instance of `LoKi::Particles::MomentumX()`

The simple function which returns X-component of the particle's momentum:
``` 1000const LHCb::Particle* B =  ... ;
1010const double px = PX ( B ) ;```

### `PY`, the instance of `LoKi::Particles::MomentumY()`

The simple function which returns Y-component of the particle's momentum:
``` 1000const LHCb::Particle* B =  ... ;
1010const double py = PY ( B ) ;```
For the invalid argument `LoKi::Constanst::InvalidMomentum` is returned.

### `PZ`, the instance of `LoKi::Particles::MomentumZ()`

The simple function which returns Z-component of the particle's momentum:
``` 1000const LHCb::Particle* B =  ... ;
1010const double pz = PZ ( B ) ;```
For the invalid argument `LoKi::Constanst::InvalidMomentum` is returned.

### `PZERO`

It is an alias for `ZERO`, see ZERO

### `Q`, the instance of `LoKi::Particles::Charge()`

The function which evaluates the charge of the particle, using the information from `LHCb::ParticleID`.
``` 1000const LHCb::Particle* p = ... ;
1010const bool positive = 0 < Q ( p ) ;```
`LoKi::Constants::InvalidCharge` is returned for invalid arguments. See also SUMQ

### `SAME`, C++ type `LoKi::TheSame<const LHCb::Particle>`

The predicate which check if the particle is the same as some reference particle.
``` 1000const LHCb::Particle* p1 = ... ;
1010Cut same = SAME ( p1 ) ;
1020
1030const LHCb::Particle* p2 = ... ;
1040const bool theSame = same  ( p2 ) ;```

### `STAT`, C++ type `LoKi::Monitoring::Stat<const LHCb::Particle*> `

The simple function, useful for monitoring of the another function. Essentially it monitors the results of another function.

``` 1000// The function to be monitored:
1010Fun fun = ... ;
1020// the generic Counter:
1030StatEntity* counter = ...;
1040// Monitored function:
1050Fun mon = STAT ( fun , counter ) ;
1060// use it!
1070for ( ... )
1080  {
1090    ...
1100    const LHCb::Particle* p = ... ;
1110    const double result = mon ( p  ) ; ///< use the function!
1120    ...
1130  }
1140...
1150info ()
1160   << " The performace:  " << endreq
1170   << " # of entries       #" << counter->nEntries() << endreq
1180   << " Total sum           "  << counter->flag () << endreq
1190   << " Mean+-RMS        "  << counter->flagMean()
1200   << "+-" << counter->flagRMS()      << endreq
1210   << " Min/Max             "   << counter->flagMin()
1220   << "/"                            << counter->flagMax() << endreq ;
1230...```
The generic counter of C++ type `StatEntity ` could be either the local counter owned by the `GaudiAlgorithm ` or `GaudiTool ` base classes, or it could be the counter from `IStatSvc ` or `ICounterSvc ` services.

The alternative (and recommended!) way for creation of the monitored function is through the function `monitor`:

``` 1000// The function to be monitored:
1010Fun fun = ... ;
1020// the generic Counter:
1030StatEntity* counter = ...;
1040// Monitored function:
1050Fun mon = monitor ( fun , counter ) ;```
E.g. in the case of local counter, it could be:
``` 1000// The function to be monitored:
1010Fun fun = ... ;
1020// Monitored function:
1030Fun mon = monitor ( fun , counter("SomeEfficiencyCounter") ) ;```

The substitution of the function could be done on-flight without disturbing of the actual processing:

``` 1000// The regular function
1010Fun fun = ... ;
1020if ( monitoring )  ///< add the monitoring capabilities (if needed)
1030 {
1040    fun = monitor ( fun , counter("SomeEfficiencyCounter") ) ;
1050 }```
The string representation of the monitored function and the unique ID are delegated to the function itself, making the object non-reconstructable from its own string representation. It is done on-purpose to avoid any interference and disturbance with the regular procession.

### `SWITCH`, C++ type `LoKi::Switch<const LHCb::Particle*>`

The function which acts according the rule: result = condition ? function1 : function2:
` 1000Fun fun = SWITCH ( 0 < Q , PT ,  1/PT ) ; `

### `SUMQ`, the instance of `LoKi::Particles::SumCharge()`

The function which evaluates the charge of the particle. For composed particles the charge is defined as the recursive sum over the charged all daughter particles, for the basic particles the information from `LHCb::ParticleID` is used
``` 1000const LHCb::Particle* B = ... ;
1010const bool positive = 0 < SUMQ ( B ) ;```
See also Q

### `SUMTREE`, C++ type `LoKi::Particles::SumTree`

The function with accumulate (by addition) the value of another function for all daughter particles inthe decay tree, which satisfy the certain criteria
``` 1000const LHCb::Particle* B = ... ;
1010// get th ealgenrac sum of all transverse momenta for the pions
1020Fun fun = SUMTREE ( PT , "pi+" == ABSID , 0.0 ) ;
1030const double sumPt = fun ( B ) ;```

### `TD`

It is an alias for `TIMEDIST`, see TIMEDIST

### `TDIST`

It is an alias for `TIMEDIST`, see TIMEDIST

### `TDSIGN`

It is an alias for `TSIGND`, see TSIGND

### `TIMEDIST`, C++ type `LoKi::Particles::TimeDistance`,

The function evaluates the proper lifetime of the particle between "end-vertex" and some reference vertex or 3D-point. The function `LoKi::Particles::VertexDistance` is used for evaluation of geometry distance.
``` 1000const LHCb::VertexBase* primary ;
1010Fun fun = TIMEDIST ( primary ) )
1020const LHCb::Particle* B = ... ;
1030const bool ctau = fun  ( B ) ;```

### `TRACKFROMPV`

It is an alias for `PVTRACK`, see PVTRACK

### `TRACKFROMPVINTREE`

It is an alias for `PVTRACKINTREE`, see PVTRACKINTREE

### `TRACKS`

It is an alias for `HASTRACKS`, see HASTRACKS

### `TRACKSINTREE`

It is an alias for `HASTRACKSINTREE`, see HASTRACKSINTREE

### `TRCHI2`, the instance of `LoKi::Particles::TrackChi2()`,

The function returns `LHCb::Track::chi2` for the underlying track:
``` 1000// get only good tracks with small chi2:
1010Range good = select ( "good" , HASTRACK && 100 > TRCHI2 ) ;  ```

### `TRCHI2DOF`, the instance of `LoKi::Particles::TrackChi2PerDoF()`,

The function returns `LHCb::Track::chi2PerDoF` for the underlying track:
``` 1000// get only good tracks with small chi2:
1010Range good = select ( "good" , HASTRACK && 3 > TRCHI2DOF ) ;  ```

### `TRHISTORY`, the instance of `LoKi::Particles::TrackHistory()`,

The function returns `LHCb::Track::history` for the underlying track:

### `TRHISTORYFIT`, the instance of `LoKi::Particles::TrackHistoryFit()`,

The function returns `LHCb::Track::historyFit` for the underlying track:

### `TRSTATUS`, the instance of `LoKi::Particles::TrackStatus()`,

The function returns `LHCb::Track::status` for the underlying track:

### `TRTYPE`, the instance of `LoKi::Particles::TrackType()`,

The function returns `LHCb::Track::type` for th eunderlying track:
``` 1000// get only long tracks:
1010Range good = select ( "long" , HASTRACK && LHCb::Track::Long == TRTYPE ) ;  ```

### `TSIGND`, C++ type `LoKi::Particles::TimeSignedDistance`,

The function evaluates the proper lifetime of the particle between "end-vertex" and some reference vertex or 3D-point. The function `LoKi::Particles::VertexSignedDistance` is used for evaluation of geometry distance.
``` 1000const LHCb::VertexBase* primary ;
1010Fun fun = TSIGND ( primary ) )
1020const LHCb::Particle* B = ... ;
1030const bool ctau = fun  ( B ) ;```

### `TDOT`, C++ type `LoKi::Particles::TimeDotDistance`,

The function evaluates the proper lifetime of the particle between "end-vertex" and some reference vertex or 3D-point along the particle momentum. The function `LoKi::Particles::VertexDotDistance` is used for evaluation of geometry distance.
``` 1000const LHCb::VertexBase* primary ;
1010Fun fun = TDOTD ( primary ) )
1020const LHCb::Particle* B = ... ;
1030const bool ctau = fun  ( B ) ;```

### `VALID`, the instance of `LoKi::Valid<const LHCb::Particle*>()`

The trivial predicate which checks the validity of the argument:
``` 1000const std::vector<const LHCb::Particle*>& p = ... ;
1010// check for invalid pointers:
1020if ( std::find_if ( p.begin() , p.end() , !VALID ) != p.end() ) { ... there are null pointers ... }  ```

### `VD`, C++ type `LoKi::Particles::VertexDistance`

The simple function which evaluates the geometrical 3D-distance between the end-vertex of the particle, , and some reference vertex or 3D-point, , as :
``` 1000const LHCb::VertexBase* primary = ... ;
1010Fun vd = VD ( primary ) ;
1020const LHCb::Particle* B = ... ;
1030const double dist = vd ( B ) ;```

### `VDCHI2`, C++ type `LoKi::Particles::VertexChi2Distance`

The simple function which evaluates the geometrical distance between the end-vertex of the particle, , and some reference vertex or 3D-point, , in units:
``` 1000const LHCb::VertexBase* primary = ... ;
1010Fun chi2d = VDCHI2 ( primary ) ;
1020const LHCb::Particle* B = ... ;
1030const double chi2 = chi2d ( B ) ;```

### `VDDOT`, C++ type `LoKi::Particles::VertexDotDistance`

The simple function which evaluates the distance between the end-vertex of the particle, , and some reference vertex or 3D-point, , along the particle momentum :
``` 1000const LHCb::VertexBase* primary = ... ;
1010Fun vd = VDDOT ( primary ) ;
1020const LHCb::Particle* B = ... ;
1030const double dist = vd ( B ) ;```

### `VDMIN`, C++ type `LoKi::Particles::MinVertexDistance`

The function which evaluates the minimal distance between the end-vertex of the particle, , and the set of the reference vertices or 3D-points: :
``` 1000CONTAINER primaries = ... ;
1010Fun fun = VDMIN ( primaries ) ;
1020const LHCb::Particle* B = ... ;
1030const double vdMin = fun ( B ) ;```

### `VDMINCHI2`, C++ type `LoKi::Particles::MinVertexDistance`

The function which evaluates the minimal -distance between the end-vertex of the particle, , and the set of the reference vertices or 3D-points: :
``` 1000CONTAINER primaries = ... ;
1010Fun fun = VDMINCHI2( primaries ) ;
1020const LHCb::Particle* B = ... ;
1030const double minChi2 = fun ( B ) ;```

### `VDSIGN`, C++ type `LoKi::Particles::VertexSignedDistance`

The simple function which evaluates the signed geometrical 3D-distance between the end-vertex of the particle , , and some reference vertex or 3D-point, , the distance is signed according to the sign of :
``` 1000const LHCb::VertexBase* primary = ... ;
1010Fun vd = VDSIGN ( primary ) ;
1020const LHCb::Particle* B = ... ;
1030const double dist = vd ( B ) ;```

### `VFASPF`, C++ type `LoKi::Particles::VFunAsPFun`

The adapter function, which applies the vertex function to the end vertex of the given particle:
``` 1000CONTAINER primaries = ... ;
1010// get long lived particles with v_z > 20 * cm
1020Range londLived = select ( "LongLived" , 20 * cm < VFASPF( VZ ) ) ;```

### `VFUNASPFUN`

It is an alias for `VFASPF`, see VFASPF

### `W`

It is an alias for `WEIGHT`, see WEIGHT

### `WEIGHT`, the instance of `LoKi::Particles::Weight()`

The simple function which returns the weight of the particle, `LHCb::Particle::weight`:
``` 1000const LHCb::Particle* p = ... ;
1010const double weight = WEIGHT ( p ) ;```

### `ZERO`, the instance of `LoKi::Constant<const LHCb::Particle*>(0)`

The most trivial function which always returns `0`

-- Vanya BELYAEV - 17 Jul 2007

This topic: LHCb > WebHome > LHCbComputing > LoKi > LoKiLUG > LoKiRefMan > LoKiParticleFunctions
Topic revision: r13 - 2018-12-19 - unknown

Copyright &© 2008-2021 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