Belle II Software development
BasicFacetRelationVarSet.cc
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#include <tracking/trackFindingCDC/filters/facetRelation/BasicFacetRelationVarSet.h>
9
10#include <tracking/trackingUtilities/eventdata/hits/CDCFacet.h>
11#include <tracking/trackingUtilities/geometry/ParameterLine2D.h>
12#include <framework/geometry/VectorUtil.h>
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16using namespace TrackingUtilities;
17
19{
20 if (not ptrFacetRelation) return false;
21
22 const CDCFacet* ptrFromFacet(ptrFacetRelation->getFrom());
23 const CDCFacet* ptrToFacet(ptrFacetRelation->getTo());
24
25 const CDCFacet& fromFacet = *ptrFromFacet;
26 const CDCFacet& toFacet = *ptrToFacet;
27
28 const ParameterLine2D& fromStartToMiddle = fromFacet.getStartToMiddleLine();
29 const ParameterLine2D& fromStartToEnd = fromFacet.getStartToEndLine();
30
31 const ParameterLine2D& toStartToEnd = toFacet.getStartToEndLine();
32 const ParameterLine2D& toMiddleToEnd = toFacet.getMiddleToEndLine();
33
34 const double fromMiddleCos = VectorUtil::CosPhi(fromStartToMiddle.tangential(), toStartToEnd.tangential());
35 const double toMiddleCos = VectorUtil::CosPhi(fromStartToEnd.tangential(), toMiddleToEnd.tangential());
36
37 const double fromMiddlePhi = acos(fromMiddleCos);
38 const double toMiddlePhi = acos(toMiddleCos);
39
40 var<named("superlayer_id")>() = fromFacet.getISuperLayer();
41 var<named("from_middle_phi")>() = fromMiddlePhi;
42 var<named("to_middle_phi")>() = toMiddlePhi;
43
44 return true;
45}
bool extract(const TrackingUtilities::Relation< const TrackingUtilities::CDCFacet > *ptrFacetRelation) final
Generate and assign the contained variables.
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition CDCFacet.h:33
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition CDCFacet.cc:94
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition CDCFacet.cc:86
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition CDCFacet.cc:102
CDC::ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
A line with a support point and tangential vector.
const ROOT::Math::XYVector & tangential() const
Gives the tangential vector of the line.
Type for two related objects.
Definition Relation.h:21
From * getFrom() const
Getter for the pointer to the from side object.
Definition Relation.h:59
To * getTo() const
Getter for the pointer to the to side object.
Definition Relation.h:65
static constexpr int named(const char *name)
Definition VarSet.h:78
Abstract base class for different kinds of events.