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