CbmRoot
Loading...
Searching...
No Matches
compareTrdHit.h
Go to the documentation of this file.
1/* Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Florian Uhlig [committer] */
4
5#ifndef COMPARETRDHIT_H
6#define COMPARETRDHIT_H 1
7
8#include "comparePixelHit.h"
9#include "gtest/gtest.h"
10
11void compareTrdHitDataMembers(CbmTrdHit& test, HitType type, double z, double dz, int32_t refid, int32_t address,
12 CbmMatch* match, double time, double errortime, double x, double dx, double y, double dy,
13 double dxy, uint8_t define, double eloss)
14{
15
16 CbmPixelHit phit = static_cast<CbmPixelHit>(test);
17 comparePixelHitDataMembers(phit, type, z, dz, refid, address, match, time, errortime, x, dx, y, dy, dxy);
18
19 int32_t retValInt {-222};
20 double retValDouble {-222.};
21
22 retValDouble = test.GetELoss();
23 EXPECT_FLOAT_EQ(eloss, retValDouble);
24
25 // Extract the first 4 bits from the integer
26 // and compare it to the functions
27 retValInt = test.GetClassType();
28 EXPECT_EQ((define & 1) >> 0, retValInt);
29
30 retValInt = test.GetMaxType();
31 EXPECT_EQ((define & 2) >> 1, retValInt);
32
33 retValInt = test.IsRowCross();
34 EXPECT_EQ((define & 4) >> 2, retValInt);
35
36 retValInt = test.HasOverFlow();
37 EXPECT_EQ((define & 8) >> 3, retValInt);
38}
39
40#endif // COMPARETRDHIT_H
HitType
Definition CbmHit.h:21
data class for a reconstructed Energy-4D measurement in the TRD
Definition CbmTrdHit.h:40
double GetELoss() const
Definition CbmTrdHit.h:79
bool GetClassType() const
Definition CbmTrdHit.h:80
bool IsRowCross() const
Definition CbmTrdHit.h:83
bool GetMaxType() const
Definition CbmTrdHit.h:81
bool HasOverFlow() const
Definition CbmTrdHit.h:82
void comparePixelHitDataMembers(CbmPixelHit &test, HitType type, double z, double dz, int32_t refid, int32_t address, CbmMatch *match, double time, double errortime, double x, double dx, double y, double dy, double dxy)
void compareTrdHitDataMembers(CbmTrdHit &test, HitType type, double z, double dz, int32_t refid, int32_t address, CbmMatch *match, double time, double errortime, double x, double dx, double y, double dy, double dxy, uint8_t define, double eloss)