| 28 | |
| 29 | == The !RaveKinematics processor == |
| 30 | |
| 31 | Again the XML snippet is used to illustrate the configuration: |
| 32 | {{{ |
| 33 | <processor name="MyRaveKinematics" type="RaveKinematics"> |
| 34 | <!--RaveKinematics uses a set of given particles to reconstruct the decay chain using the given constraints--> |
| 35 | <!--Name of the input particle collection--> |
| 36 | <parameter name="Particles" type="string" lcioInType="ReconstructedParticle">Particles </parameter> |
| 37 | <!--Decay topology to be used for the fitting; registered: SingleVertex, TwoTrackMass, WW4Jet, --> |
| 38 | <parameter name="Topology" type="string">SingleVertex </parameter> |
| 39 | <!--Print results to stdout--> |
| 40 | <!--Topology parameters forwarded to the selected topology--> |
| 41 | <parameter name="Parameters" type="string"> </parameter> |
| 42 | <parameter name="Verbose" type="int">0 </parameter> |
| 43 | <!--Name of the output collection of particles linked to a decay chain--> |
| 44 | <parameter name="KinematicParticles" type="string" lcioOutType="ReconstructedParticle">KinematicParticles </parameter> |
| 45 | <!--Name of the reconstructed vertex collection linked to a decay chain--> |
| 46 | <parameter name="KinematicVertices" type="string" lcioOutType="Vertex">KinematicVertices </parameter> |
| 47 | </processor> |
| 48 | }}} |
| 49 | The input in this case is a !ReconstructedParticle collection named Particles. The decay hypothesis is chosen by means of the Topology parameter which will be explained below. A string of parameters can be passed to the chosen topology. The `rave::KinematicTree` produced by the fitter is split into a !ReconstructedParticle and a Vertex collection to represent the edges and nodes of the tree. |
| 50 | |
| 51 | Currently available topologies are: |
| 52 | * !SingleVertex : Fits all particles to one vertex and returns a mother particle without further constraints |
| 53 | * !TwoTrackMass : Does a similar job, but constraints the invariant mass of the first two found particles to a given value |
| 54 | * WW4Jet : Reconstructs the masses of two Ws from four given jets. The input collection needs to have exactly four particles output by a !JetFinder and representing the jets. |
| 55 | |
| 56 | === Custom topologies === |
| 57 | |
| 58 | Arbitrary topologies can be used by inheriting the !KinematicTopology class provided by MarlinRave and implementing the interface. The implementation in form of one .cc file has to be copied into the "topologies" directory of the MarlinRave source tree and the build will automatically include the new topology during the next run. |
| 59 | |
| 60 | The perhaps most simple yet meaningful example is the !SingleVertex topology: |
| 61 | {{{ |
| 62 | #include "KinematicTopology.h" |
| 63 | #include <rave/KinematicTreeFactory.h> |
| 64 | |
| 65 | class TopologySingleVertex : |
| 66 | public KinematicTopology |
| 67 | { |
| 68 | public: |
| 69 | std::string describe() const { |
| 70 | return "Reconstructs a mother particle from all given daughters."; |
| 71 | }; |
| 72 | |
| 73 | rave::KinematicTree build( |
| 74 | const rave::KinematicTreeFactory & factory, |
| 75 | const std::vector< rave::KinematicParticle > & particles, |
| 76 | const int verbose = 0) const |
| 77 | { |
| 78 | return factory.useVertexFitter( particles ); |
| 79 | }; |
| 80 | |
| 81 | bool valid() const { return true; }; |
| 82 | }; |
| 83 | |
| 84 | #include "TopologyBuilder.h" |
| 85 | namespace { |
| 86 | TopologyBuilder<TopologySingleVertex> t( "SingleVertex", "Only vertex" ); |
| 87 | } |
| 88 | }}} |
| 89 | |
| 90 | The three methods implemented here are the minimum interface for a usable topology. The `describe` method should return a string explaining the decay hypothesis implemented by this topology and maybe commenting on the possible parameters accepted by the topology. The `valid` method provides simple means to check on the given parameters. I will explain later how to use parameters. |
| 91 | |
| 92 | The central method of the topology is the `build` method. It is supplied with an instance of a `rave::KinematicTreeFactory` providing full access to the Rave kinematic fitting algorithms and with the input particles read from the Marlin reconstruction chain. It has to return a `rave::KinematicTree` holding the reconstructed decay tree as it may have looked like if the decay hypothesis assumed by the topology were true. In the case of the !SingleVertex topology the tree can be constructed and returned by one simple call. The `build` method of course will be significantly longer in more complex situations. |
| 93 | |
| 94 | The WW4Jet topology is an example of a situation with a certain level of difficulty. |