Belle II Software development
CDCTrigger3DHTrack.h
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
9#pragma once
10
11#include <vector>
12#include <array>
13#include <cstdint>
14
15#include "framework/dataobjects/Helix.h"
16#include "framework/geometry/BFieldManager.h"
17
18namespace Belle2 {
23
24 // Track created by the CDC trigger with 3DHough Finder input.
25 class CDCTrigger3DHTrack : public Helix {
26 public:
27 // Default constructor = initializing everything to 0/-1
28 CDCTrigger3DHTrack(): Helix() {}
29
36 CDCTrigger3DHTrack(double phi0, double omega, double z0, double cotTheta):
37 Helix(0., phi0, omega, z0, cotTheta) {}
38
39 // Default destructor
40 ~CDCTrigger3DHTrack() = default;
41
42 // Setter methods for private variables (that are not part of the Helix class)
43 void setQuadrant(const short quadrant) { m_quadrant = quadrant; };
44 void setNNTClassification(const double classification) { m_classificationNNT = classification; }
45 void setSTTClassification(const double classification) { m_classificationSTT = classification; }
46 void setTotalMomentum(const double totalMomentum) { m_totalMomentum = totalMomentum; }
47 void setTime(const int time) { m_time = time; }
48 void setDriftThreshold(const std::vector<bool>& driftThreshold) { m_driftThreshold = driftThreshold; }
49 void setTSVector(const std::array<unsigned short, 9>& tsVector) { m_tsVector = tsVector; }
50 void setValidTrackBit(const bool validTrackBit) { m_validTrackBit = validTrackBit; }
51 void setNNTBit(const bool nntBit) { m_nntBit = nntBit; }
52 void setSTTBit(const bool sttBit) { m_sttBit = sttBit; }
53 void setFloatInput(const std::vector<float>& floatInput) { m_floatInput = floatInput; }
54 void setRawInput(const std::vector<int>& rawInput) { m_rawInput = rawInput; }
55 void setRawOutput(const std::vector<int>& rawOutput) { m_rawOutput = rawOutput; }
56 void setRaw3DHMaximum(const std::array<int, 4>& raw3DHMaximum) { m_raw3DHMaximum = raw3DHMaximum; }
57 void setHoughSpace(const std::vector<uint8_t>& houghSpace) { m_houghSpace = std::move(houghSpace); }
58
59 // Corresponding getter methods
60 short getQuadrant() const { return m_quadrant; }
61 double getNNTClassification() const { return m_classificationNNT; }
62 double getSTTClassification() const { return m_classificationSTT; }
63 double getTotalMomentum() const { return m_totalMomentum; }
64 float getTime() const { return m_time; }
65 std::vector<bool> getDriftThreshold() const { return m_driftThreshold; }
66 std::array<unsigned short, 9> getTSVector() const { return m_tsVector; }
67 double getPt() const
68 {
69 const double bField = 1.5;
70 return getTransverseMomentum(bField);
71 }
72 bool getValidTrackBit() const { return m_validTrackBit; }
73 bool getNNTBit() const { return m_nntBit; }
74 bool getSTTBit() const { return m_sttBit; }
75 std::vector<float> getFloatInput() const { return m_floatInput; }
76 std::vector<int> getRawInput() const { return m_rawInput; }
77 std::vector<int> getRawOutput() const { return m_rawOutput; }
78 std::array<int, 4> getRaw3DHMaximum() const { return m_raw3DHMaximum; }
79 std::vector<int> getHoughSpace() const { return std::vector<int>(m_houghSpace.begin(), m_houghSpace.end()); }
80
81 private:
82 // Number of trigger clocks of (the track output - L1 trigger) (HW)
83 int m_time{0};
84 // Store if drift time was within the timing window (HW)
85 std::vector<bool> m_driftThreshold;
86 // Store the left/right info of the found track segments for each super layer (HW and SW)
87 std::array<unsigned short, 9> m_tsVector{0};
88 // The found CDC quadrant (HW and SW)
89 short m_quadrant{-1};
90 // Network classification of the nnt-bit/y-bit (z from IP) (HW and SW)
91 double m_classificationNNT{-1.0};
92 // Network classification of the stt-bit (p > 0.7 GeV and z from IP) (HW and SW)
93 double m_classificationSTT{-1.0};
94 // Network total momentum prediction
95 double m_totalMomentum{-1.0};
96 // Whether the track segments are sufficient for Neuro track
97 bool m_validTrackBit{false};
98 // NNT decision that the firmware passed to gdl (HW and SW)
99 bool m_nntBit{false};
100 // STT decision that the firmware passed to gdl (HW and SW)
101 bool m_sttBit{false};
102 // Values to store the float network input (SW)
103 std::vector<float> m_floatInput;
104 // Values to store the raw network input (HW)
105 std::vector<int> m_rawInput;
106 // Values to store the raw network output (HW)
107 std::vector<int> m_rawOutput;
108 // Values to store the raw 3DHough maximum (HW and SW)
109 std::array<int, 4> m_raw3DHMaximum;
110 // Store the full Hough space (SW)
111 std::vector<uint8_t> m_houghSpace;
112
113 ClassDef(CDCTrigger3DHTrack, 1);
114 };
115
116}
CDCTrigger3DHTrack(double phi0, double omega, double z0, double cotTheta)
Parameter constructor (helix only)
Helix(const HepPoint3D &pivot, const HepVector &a, const HepSymMatrix &Ea)
Constructor with pivot, helix parameter a, and its error matrix.
Definition Helix.cc:132
double phi0(void) const
Return helix parameter phi0.
Definition Helix.h:388
Abstract base class for different kinds of events.