Belle II Software  release-05-01-25
BasicFacetVarSet.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/facet/BasicFacetVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13 
14 using namespace Belle2;
15 using namespace TrackFindingCDC;
16 
17 bool BasicFacetVarSet::extract(const CDCFacet* ptrFacet)
18 {
19  if (not ptrFacet) return false;
20  const CDCFacet& facet = *ptrFacet;
21 
22  const ISuperLayer superlayerID = facet.getISuperLayer();
23 
24  const CDCRLWireHit& startRLWirehit = facet.getStartRLWireHit();
25  const double startDriftLength = startRLWirehit.getSignedRefDriftLength();
26  const double startDriftLengthVar = startRLWirehit.getRefDriftLengthVariance();
27  const double startDriftLengthSigma = sqrt(startDriftLengthVar);
28 
29  const CDCRLWireHit& middleRLWirehit = facet.getMiddleRLWireHit();
30  const double middleDriftLength = middleRLWirehit.getSignedRefDriftLength();
31  const double middleDriftLengthVar = middleRLWirehit.getRefDriftLengthVariance();
32  const double middleDriftLengthSigma = sqrt(middleDriftLengthVar);
33 
34  const CDCRLWireHit& endRLWirehit = facet.getEndRLWireHit();
35  const double endDriftLength = endRLWirehit.getSignedRefDriftLength();
36  const double endDriftLengthVar = endRLWirehit.getRefDriftLengthVariance();
37  const double endDriftLengthSigma = sqrt(endDriftLengthVar);
38 
39  const ERightLeft startRLInfo = facet.getStartRLInfo();
40  const ERightLeft middleRLInfo = facet.getMiddleRLInfo();
41  const ERightLeft endRLInfo = facet.getEndRLInfo();
42  const CDCRLWireHitTriple::Shape shape = facet.getShape();
43  const short oClockDelta = shape.getOClockDelta();
44  const short cellExtend = shape.getCellExtend();
45  const short stableTwist = -sign(shape.getOClockDelta()) * middleRLInfo;
46  const bool startToMiddleIsCrossing = startRLInfo != middleRLInfo;
47  const bool middleToEndIsCrossing = middleRLInfo != endRLInfo;
48 
49  var<named("superlayer_id")>() = superlayerID;
50 
51  // var<named("start_layer_id")>() = facet.getStartWire().getILayer();
52  var<named("start_drift_length")>() = startDriftLength;
53  var<named("start_drift_length_sigma")>() = startDriftLengthSigma;
54 
55  // var<named("middle_layer_id")>() = facet.getMiddleWire().getILayer();
56  var<named("middle_drift_length")>() = middleDriftLength;
57  var<named("middle_drift_length_sigma")>() = middleDriftLengthSigma;
58 
59  // var<named("end_layer_id")>() = facet.getEndWire().getILayer();
60  var<named("end_drift_length")>() = endDriftLength;
61  var<named("end_drift_length_sigma")>() = endDriftLengthSigma;
62 
63  var<named("oclock_delta")>() = oClockDelta;
64  var<named("twist")>() = stableTwist;
65  var<named("cell_extend")>() = cellExtend;
66  var<named("n_crossing")>() = startToMiddleIsCrossing + middleToEndIsCrossing;
67 
68  facet.adjustFitLine();
69  UncertainParameterLine2D fitLine = facet.getFitLine();
70  double alpha = fitLine->at(0.5).angleWith(fitLine->tangential());
71  var<named("alpha")>() = alpha;
72  return true;
73 }
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getShape
Shape getShape() const
Getter for the shape of this tiple if all three oriented wire hits are neighbors. Else ILLSHAPE.
Definition: CDCRLWireHitTriple.cc:97
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndRLInfo
ERightLeft getEndRLInfo() const
Getter for the right left passage information of the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:206
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleRLInfo
ERightLeft getMiddleRLInfo() const
Getter for the right left passage information of the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:200
Belle2::TrackFindingCDC::ParameterLine2D::at
Vector2D at(const double parameter) const
Evaluates the line formula at the parameter given.
Definition: ParameterLine2D.h:152
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartRLInfo
ERightLeft getStartRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:194
Belle2::TrackFindingCDC::CDCRLWireHit::getSignedRefDriftLength
double getSignedRefDriftLength() const
Getter for the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:226
Belle2::TrackFindingCDC::CDCFacet::adjustFitLine
void adjustFitLine() const
Adjusts the contained fit line to touch such that it touches the first and third hit.
Definition: CDCFacet.cc:63
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape
Type for the different shapes of a triple of neighboring wire hits.
Definition: CDCRLWireHitTriple.h:48
Belle2::TrackFindingCDC::CDCRLWireHit::getRefDriftLengthVariance
double getRefDriftLengthVariance() const
Getter for the variance of the drift length at the reference position of the wire.
Definition: CDCRLWireHit.h:232
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CDCRLWireHit
Class representing an oriented hit wire including a hypotheses whether the causing track passes left ...
Definition: CDCRLWireHit.h:51
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getOClockDelta
short getOClockDelta() const
Getter for the o'clock direction difference from start to middle compared to middle to end.
Definition: CDCRLWireHitTriple.cc:54
Belle2::TrackFindingCDC::NRightLeft::ERightLeft
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:35
Belle2::TrackFindingCDC::BasicFacetVarSet::extract
bool extract(const CDCFacet *ptrFacet) final
Generate and assign the contained variables.
Definition: BasicFacetVarSet.cc:17
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getMiddleRLWireHit
CDCRLWireHit & getMiddleRLWireHit()
Getter for the second oriented wire hit.
Definition: CDCRLWireHitTriple.h:243
Belle2::TrackFindingCDC::CDCFacet
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:42
Belle2::TrackFindingCDC::ParameterLine2D::tangential
const Vector2D & tangential() const
Gives the tangential vector of the line.
Definition: ParameterLine2D.h:135
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndRLWireHit
CDCRLWireHit & getEndRLWireHit()
Getter for the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:249
Belle2::TrackFindingCDC::VarSet< BasicFacetVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::Vector2D::angleWith
double angleWith(const Vector2D &rhs) const
The angle between this and rhs.
Definition: Vector2D.h:211
Belle2::TrackFindingCDC::VarSet< BasicFacetVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103
Belle2::TrackFindingCDC::UncertainParameterLine2D
A parameter line including including an line covariance matrix which is interpreted as located in the...
Definition: UncertainParameterLine2D.h:34
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape::getCellExtend
short getCellExtend() const
Getter for the sum of cell distances from start to middle and middle to end.
Definition: CDCRLWireHitTriple.cc:49
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartRLWireHit
CDCRLWireHit & getStartRLWireHit()
Getter for the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:237
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
Definition: CDCRLWireHitTriple.h:151
Belle2::TrackFindingCDC::CDCFacet::getFitLine
const UncertainParameterLine2D & getFitLine() const
Getter for the contained line fit information.
Definition: CDCFacet.h:71