Belle II Software  release-05-01-25
FitlessFacetVarSet.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/FitlessFacetVarSet.h>
11 
12 #include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
13 
14 #include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
15 
16 using namespace Belle2;
17 using namespace TrackFindingCDC;
18 
20 {
21  if (not ptrFacet) return false;
22  const CDCFacet& facet = *ptrFacet;
23 
24  const CDCFacet::Shape shape = facet.getShape();
25 
26  const short cellExtend = shape.getCellExtend();
27  const short oClockDelta = shape.getOClockDelta();
28  const short absOClockDelta = std::abs(oClockDelta);
29 
30  const ERightLeft startRLInfo = facet.getStartRLInfo();
31  const ERightLeft middleRLInfo = facet.getMiddleRLInfo();
32  const ERightLeft endRLInfo = facet.getEndRLInfo();
33 
34  const short stableTwist = -sign(shape.getOClockDelta()) * middleRLInfo;
35  const bool startToMiddleIsCrossing = startRLInfo != middleRLInfo;
36  const bool middleToEndIsCrossing = middleRLInfo != endRLInfo;
37 
38  const bool startToMiddleIsLong = shape.getStartToMiddleCellDistance() > shape.getMiddleToEndCellDistance();
39 
40  const bool longArmIsCrossing = startToMiddleIsLong ? startToMiddleIsCrossing : middleToEndIsCrossing;
41  const bool shortArmIsCrossing = startToMiddleIsLong ? middleToEndIsCrossing : startToMiddleIsCrossing;
42  const short iLayerDifference = facet.getStartWireHit().getILayer() - facet.getEndWireHit().getILayer();
43  const short absILayerDifference = std::abs(iLayerDifference);
44 
45  var<named("superlayer_id")>() = facet.getISuperLayer();
46  var<named("cell_extend")>() = cellExtend;
47  var<named("oclock_delta")>() = shape.getOClockDelta();
48  var<named("abs_oclock_delta")>() = absOClockDelta;
49  var<named("layer_id_difference")>() = iLayerDifference;
50  var<named("abs_layer_id_difference")>() = absILayerDifference;
51 
52  var<named("long_arm_is_crossing")>() = longArmIsCrossing;
53  var<named("short_arm_is_crossing")>() = shortArmIsCrossing;
54  var<named("stable_twist")>() = stableTwist;
55 
56  var<named("crossing_id")>() = std::copysign(100.0 * std::abs(stableTwist) +
57  10.0 * shortArmIsCrossing +
58  1.0 * longArmIsCrossing,
59  stableTwist);
60 
61  var<named("shape_id")>() = 100.0 * cellExtend + absOClockDelta;
62  return true;
63 }
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::Shape::getStartToMiddleCellDistance
short getStartToMiddleCellDistance() const
Getter for the start to middle cell distance.
Definition: CDCRLWireHitTriple.cc:39
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::CDCWireHit::getILayer
ILayer getILayer() const
Getter for the layer id.
Definition: CDCWireHit.h:217
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getStartWireHit
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:212
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::CDCRLWireHitTriple::getStartRLInfo
ERightLeft getStartRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
Definition: CDCRLWireHitTriple.h:194
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getEndWireHit
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
Definition: CDCRLWireHitTriple.h:224
Belle2::TrackFindingCDC::CDCRLWireHitTriple::Shape
Type for the different shapes of a triple of neighboring wire hits.
Definition: CDCRLWireHitTriple.h:48
Belle2::TrackFindingCDC::FitlessFacetVarSet::extract
bool extract(const CDCFacet *ptrFacet) final
Generate and assign the contained variables.
Definition: FitlessFacetVarSet.cc:19
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
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::CDCFacet
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:42
Belle2::TrackFindingCDC::VarSet< FitlessFacetVarNames >::named
constexpr static int named(const char *name)
Getter for the index from the name.
Definition: VarSet.h:88
Belle2::TrackFindingCDC::VarSet< FitlessFacetVarNames >::var
Float_t & var()
Reference getter for the value of the ith variable. Static version.
Definition: VarSet.h:103
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::Shape::getMiddleToEndCellDistance
short getMiddleToEndCellDistance() const
Getter for the middle to end cell distance.
Definition: CDCRLWireHitTriple.cc:44
Belle2::TrackFindingCDC::CDCRLWireHitTriple::getISuperLayer
ISuperLayer getISuperLayer() const
Getter for the common superlayer id of the pair.
Definition: CDCRLWireHitTriple.h:151