Skip to content

Commit 6654659

Browse files
committed
Merge pull request #846 in B2/basf2 from bugfix/BII-8733-neurotrigger-unpacker-and-nnta-rel to release/06-01
* commit 'a065e547869d024e41cabf49fc6ab2acfea9cae4': fix classversion of cdctriggertrack fix some compiler warnings add etf timing to cdctriggerneuroinput2dfindetracks fix errors in nntd script add hwneurovals to nntd module (neurotrigger) add 2 timing sources to neurotrack: etfcc, etfhwin add new quality flags for nnt in unpacker update nntscripts, add nntd script, fix nnt code fix classversion of cdctriggertrack +debug info, fix t0 calculation neurotrigger: remove some consts to fix code +etf in nnt, +raw hwvals in tracks, mod tsvector
2 parents 63a7335 + a065e54 commit 6654659

File tree

12 files changed

+736
-228
lines changed

12 files changed

+736
-228
lines changed

trg/cdc/dataobjects/include/CDCTriggerTrack.h

Lines changed: 59 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Belle2 {
1919
public:
2020
/** default constructor, initializing everything to 0. */
2121
CDCTriggerTrack(): Helix(), m_chi2D(0.), m_chi3D(0.), m_time(0), m_quadrant(-1), m_foundoldtrack(6, false), m_driftthreshold(9,
22-
false), m_valstereobit(false) , m_expert(-1), m_tsvector(9, false), m_qualityvector(0) { }
22+
false), m_valstereobit(false) , m_expert(-1), m_tsvector(9, 0), m_qualityvector(0) { }
2323

2424
/** 2D constructor, initializing 3D values to 0.
2525
* @param phi0 The angle between the transverse momentum and the x axis and in [-pi, pi].
@@ -45,7 +45,7 @@ namespace Belle2 {
4545
m_driftthreshold(driftthreshold),
4646
m_valstereobit(valstereobit),
4747
m_expert(expert),
48-
m_tsvector(9, false),
48+
m_tsvector(9, 0),
4949
m_qualityvector(0) { }
5050

5151
CDCTriggerTrack(double phi0, double omega, double chi2,
@@ -58,7 +58,7 @@ namespace Belle2 {
5858
m_driftthreshold(9, false),
5959
m_valstereobit(false),
6060
m_expert(-1),
61-
m_tsvector(9, false),
61+
m_tsvector(9, 0),
6262
m_qualityvector(0) { }
6363

6464
/** 3D constructor
@@ -77,7 +77,7 @@ namespace Belle2 {
7777
const std::vector<bool>& driftthreshold = std::vector<bool>(9, false),
7878
bool valstereobit = false,
7979
int expert = -1,
80-
const std::vector<bool>& tsvector = std::vector<bool>(9, false),
80+
const std::vector<unsigned>& tsvector = std::vector<unsigned>(9, 0),
8181
short time = 0, short quadrant = -1,
8282
unsigned qualityvector = 0):
8383
Helix(0., phi0, omega, z0, cotTheta), m_chi2D(chi2D), m_chi3D(chi3D), m_time(time), m_quadrant(quadrant),
@@ -86,7 +86,9 @@ namespace Belle2 {
8686
m_valstereobit(valstereobit),
8787
m_expert(expert),
8888
m_tsvector(tsvector),
89-
m_qualityvector(qualityvector) { }
89+
m_qualityvector(qualityvector),
90+
m_etf_unpacked(0),
91+
m_etf_recalced(0) { }
9092
/** destructor, empty because we don't allocate memory anywhere. */
9193
~CDCTriggerTrack() { }
9294

@@ -106,7 +108,7 @@ namespace Belle2 {
106108
return getTransverseMomentum(bField);
107109
}
108110
/** get the quadrant */
109-
short getQuadrant()
111+
short getQuadrant() const
110112
{
111113
return m_quadrant;
112114
}
@@ -124,7 +126,7 @@ namespace Belle2 {
124126

125127
/** return the vector of used Track Segments.
126128
* The First bit is the innermost TS, the last bit the outermost. */
127-
std::vector<bool> getTSVector() const {return m_tsvector;}
129+
std::vector<unsigned> getTSVector() const {return m_tsvector;}
128130
/** setter and getter for the quality vector. For the setter, the given
129131
* uint is xored with the current qualityvector, thus all bits with
130132
* a 1 are changed.
@@ -134,9 +136,36 @@ namespace Belle2 {
134136
m_qualityvector = m_qualityvector ^ newbits;
135137
}
136138
unsigned getQualityVector() const {return m_qualityvector;}
139+
void setHasETFTime(bool x) {m_hasETFTime = x;}
140+
bool getHasETFTime() const {return m_hasETFTime;}
141+
/** getter and setter functions for etf timing */
142+
int getETF_unpacked() const {return m_etf_unpacked;}
143+
int getETF_recalced() const {return m_etf_recalced;}
144+
void setETF_unpacked(int x) {m_etf_unpacked = x;}
145+
void setETF_recalced(int x) {m_etf_recalced = x;}
146+
/** setter and getter functions for raw track values */
147+
void setRawPhi0(const int phi0)
148+
{
149+
m_rawphi0 = phi0;
150+
}
151+
void setRawOmega(const int omega)
152+
{
153+
m_rawomega = omega;
154+
}
155+
void setRawZ(const int z)
156+
{
157+
m_rawz = z;
158+
}
159+
void setRawTheta(const int theta)
160+
{
161+
m_rawtheta = theta;
162+
}
163+
int getRawPhi0() const {return m_rawphi0;}
164+
int getRawOmega() const {return m_rawomega;}
165+
int getRawZ() const {return m_rawz;}
166+
int getRawTheta() const {return m_rawtheta;}
137167

138168
protected:
139-
/** chi2 value from 2D fitter */
140169
float m_chi2D;
141170
/** chi2 value from 3D fitter */
142171
float m_chi3D;
@@ -154,13 +183,33 @@ namespace Belle2 {
154183
int m_expert;
155184
/** store which track segments were used.
156185
* The First bit is the innermost TS, the last bit the outermost. */
157-
std::vector<bool> m_tsvector;
186+
std::vector<unsigned> m_tsvector;
158187
/** store bits for different quality flags.
159188
* 2^0 : 0 if all axial ts are contained in the related 2dfindertrack; 1 otherwise.
189+
* 2^1 : 0 if hwsim nntrack is less than 1cm in z away from hwtrack; 1 otherwise.
190+
* 2^2 : 0 if all input values for the ID are exactly the same in hw and hwsim; 1 otherwise.
191+
* 2^3 : 0 if all input values for alpa are exactly the same in hw and hwsim; 1 otherwise.
192+
* 2^4 : 1 if dt in hw/hwsim is 0 and in hwsim/hw is 1; 0 otherwise.
193+
* 2^5 : 1 if all inputs in hw are 0 but at least 1 is filled in hwsim; 0 otherwise.
194+
* 2^6 : 1 if all inputs in hwsim are 0 but at least 1 is filled in hw; 0 otherwise.
195+
* 2^7 : 1 if more than 1 etf time was recalculated from hw. this indicates, that an old input
196+
* from a previous track was used in the network.
160197
*/
161198
unsigned m_qualityvector;
199+
/** unpacked etf time from the unpacker */
200+
int m_etf_unpacked;
201+
/** etf time recalculated from the hw input */
202+
int m_etf_recalced;
203+
/** chi2 value from 2D fitter */
204+
bool m_hasETFTime{0};
205+
/** values to store the raw network and 2dfinder output */
206+
int m_rawphi0{0};
207+
int m_rawomega{0};
208+
int m_rawz{0};
209+
int m_rawtheta{0};
162210
//! Needed to make the ROOT object storable
163-
ClassDef(CDCTriggerTrack, 9);
211+
ClassDef(CDCTriggerTrack, 14);
212+
164213
};
165214
}
166215
#endif

trg/cdc/dataobjects/include/linkdef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#pragma link C++ class bitset <639>+; // checksum=0x88f24d, version=2
1212
#pragma link C++ class bitset <256>+; // checksum=0x88f1ea, version=2
1313
#pragma link C++ class Belle2::CDCTriggerSegmentHit+; // checksum=0x89ed4679, version=4
14-
#pragma link C++ class Belle2::CDCTriggerTrack+; // checksum=0x589cc554, version=9
14+
#pragma link C++ class Belle2::CDCTriggerTrack+; // checksum=0xdde6f688, version=14
1515
#pragma link C++ class Belle2::CDCTriggerMLP+; // checksum=0x2d137aa, version=7
1616
#pragma link C++ class Belle2::CDCTriggerMLPData+; // checksum=0x48969a58, version=1
1717
#pragma link C++ class Belle2::CDCTriggerMLPInput+; // checksum=0x6fd59940, version=1

trg/cdc/include/NeuroTrigger.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
**************************************************************************/
88
#ifndef NEUROTRIGGER_H
99
#define NEUROTRIGGER_H
10-
10+
#pragma once
11+
#include <string>
1112
#include <trg/cdc/dataobjects/CDCTriggerMLP.h>
1213
#include <framework/datastore/StoreArray.h>
1314
#include <framework/datastore/StoreObjPtr.h>
@@ -142,6 +143,7 @@ namespace Belle2 {
142143
/** set the hit collection and event time to required
143144
* and store the hit collection name */
144145
void initializeCollections(std::string hitCollectionName, std::string eventTimeName, const std::string& et_option);
146+
void initializeCollections(std::string hitCollectionName);
145147

146148
/** return reference to a neural network */
147149
CDCTriggerMLP& operator[](unsigned index) { return m_MLPs[index]; }
@@ -179,6 +181,8 @@ namespace Belle2 {
179181
/** Calculate phi position of a hit relative to 2D track
180182
* (scaled to number of wires). */
181183
double getRelId(const CDCTriggerSegmentHit& hit);
184+
/** helper function to get the fastest priority time of given ts array */
185+
int getLowestTime(unsigned isector, RelationVector<CDCTriggerSegmentHit> Hits, bool onlyAxials);
182186
/** Read out the event time and store it.
183187
* It can be given different options in the et_option ("EventTime option")
184188
* parameter.

0 commit comments

Comments
 (0)