Belle II Software development
FitlessFacetVarSet.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/FitlessFacetVarSet.h>
9
10#include <tracking/trackFindingCDC/eventdata/hits/CDCWireHit.h>
11
12#include <tracking/trackFindingCDC/eventdata/hits/CDCFacet.h>
13
14using namespace Belle2;
15using namespace TrackFindingCDC;
16
18{
19 if (not ptrFacet) return false;
20 const CDCFacet& facet = *ptrFacet;
21
22 const CDCFacet::Shape shape = facet.getShape();
23
24 const short cellExtend = shape.getCellExtend();
25 const short oClockDelta = shape.getOClockDelta();
26 const short absOClockDelta = std::abs(oClockDelta);
27
28 const ERightLeft startRLInfo = facet.getStartRLInfo();
29 const ERightLeft middleRLInfo = facet.getMiddleRLInfo();
30 const ERightLeft endRLInfo = facet.getEndRLInfo();
31
32 const short stableTwist = -sign(shape.getOClockDelta()) * middleRLInfo;
33 const bool startToMiddleIsCrossing = startRLInfo != middleRLInfo;
34 const bool middleToEndIsCrossing = middleRLInfo != endRLInfo;
35
36 const bool startToMiddleIsLong = shape.getStartToMiddleCellDistance() > shape.getMiddleToEndCellDistance();
37
38 const bool longArmIsCrossing = startToMiddleIsLong ? startToMiddleIsCrossing : middleToEndIsCrossing;
39 const bool shortArmIsCrossing = startToMiddleIsLong ? middleToEndIsCrossing : startToMiddleIsCrossing;
40 const short iLayerDifference = facet.getStartWireHit().getILayer() - facet.getEndWireHit().getILayer();
41 const short absILayerDifference = std::abs(iLayerDifference);
42
43 var<named("superlayer_id")>() = facet.getISuperLayer();
44 var<named("cell_extend")>() = cellExtend;
45 var<named("oclock_delta")>() = shape.getOClockDelta();
46 var<named("abs_oclock_delta")>() = absOClockDelta;
47 var<named("layer_id_difference")>() = iLayerDifference;
48 var<named("abs_layer_id_difference")>() = absILayerDifference;
49
50 var<named("long_arm_is_crossing")>() = longArmIsCrossing;
51 var<named("short_arm_is_crossing")>() = shortArmIsCrossing;
52 var<named("stable_twist")>() = stableTwist;
53
54 var<named("crossing_id")>() = std::copysign(100.0 * std::abs(stableTwist) +
55 10.0 * shortArmIsCrossing +
56 1.0 * longArmIsCrossing,
57 stableTwist);
58
59 var<named("shape_id")>() = 100.0 * cellExtend + absOClockDelta;
60 return true;
61}
Class representing a triple of neighboring oriented wire with additional trajectory information.
Definition: CDCFacet.h:32
Type for the different shapes of a triple of neighboring wire hits.
short getMiddleToEndCellDistance() const
Getter for the middle to end cell distance.
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.
short getStartToMiddleCellDistance() const
Getter for the start to middle cell distance.
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.
ERightLeft getStartRLInfo() const
Getter for the right left passage information of the first oriented wire hit.
const CDCWireHit & getEndWireHit() const
Getter for the hit wire of the third oriented wire hit.
ERightLeft getEndRLInfo() const
Getter for the right left passage information of the third oriented wire hit.
const CDCWireHit & getStartWireHit() const
Getter for the hit wire of the first oriented wire hit.
Shape getShape() const
Getter for the shape of this triple if all three oriented wire hits are neighbors....
ILayer getILayer() const
Getter for the layer id.
Definition: CDCWireHit.h:209
bool extract(const CDCFacet *ptrFacet) final
Generate and assign the contained variables.
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
ERightLeft
Enumeration to represent the distinct possibilities of the right left passage.
Definition: ERightLeft.h:25
Abstract base class for different kinds of events.