Belle II Software  release-05-01-25
BasicFacetRelationVarSet.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #include <tracking/trackFindingCDC/filters/facetRelation/BasicFacetRelationVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13 #include <tracking/trackFindingCDC/geometry/ParameterLine2D.h>
14 
15 using namespace Belle2;
16 using namespace TrackFindingCDC;
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 = fromStartToMiddle.tangential().cosWith(toStartToEnd.tangential());
35  const double toMiddleCos = fromStartToEnd.tangential().cosWith(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 }
Belle2::TrackFindingCDC::CDCFacet::getStartToEndLine
ParameterLine2D getStartToEndLine() const
Getter for the tangential line from the first to the third hit.
Definition: CDCFacet.cc:96
Belle2::TrackFindingCDC::Relation
Type for two related objects.
Definition: CDCSegment2D.h:37
Belle2::TrackFindingCDC::ParameterLine2D
A line with a support point and tangential vector.
Definition: ParameterLine2D.h:48
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::BasicFacetRelationVarSet::extract
bool extract(const Relation< const CDCFacet > *ptrFacetRelation) final
Generate and assign the contained variables.
Definition: BasicFacetRelationVarSet.cc:18
Belle2::TrackFindingCDC::CDCFacet::getStartToMiddleLine
ParameterLine2D getStartToMiddleLine() const
Getter for the tangential line from the first to the second hit.
Definition: CDCFacet.cc:88
Belle2::TrackFindingCDC::CDCFacet
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:42
Belle2::TrackFindingCDC::Vector2D::cosWith
double cosWith(const Vector2D &rhs) const
Definition: Vector2D.h:201
Belle2::TrackFindingCDC::ParameterLine2D::tangential
const Vector2D & tangential() const
Gives the tangential vector of the line.
Definition: ParameterLine2D.h:135
Belle2::TrackFindingCDC::CDCFacet::getMiddleToEndLine
ParameterLine2D getMiddleToEndLine() const
Getter for the tangential line from the second to the third hit.
Definition: CDCFacet.cc:104
Belle2::TrackFindingCDC::VarSet< BasicFacetRelationVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::VarSet< BasicFacetRelationVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
Definition: CDCRLWireHitTriple.h:151