PandaRoot
FTSCATES.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 //-*- Mode: C++ -*-
14 // *****************************************************************************
15 // *
16 // @Autors: I.Kulakov; M.Pugach; M.Zyzak; I.Kisel *
17 // @e-mail: I.Kulakov@gsi.de; M.Pugach@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de *
18 // *
19 // *****************************************************************************
20 
21 #ifndef FTSCATES_H
22 #define FTSCATES_H
23 
24 struct TES { // Type for an Element on Station
25  TES() : s(-1), e(-1) {}
26  TES(char is, unsigned int ie) : s(is), e(ie) {}
27  TES(unsigned int ie, char is) : s(is), e(ie) {} // to prevent confusion
28 
29  operator unsigned int() { return e; }
30 
31  friend bool operator!=(const TES &a, const TES &b) { return (a.s != b.s) || (a.e != b.e); }
32 
33  char s; // index of station
34  unsigned int e; // index of element
35 };
36 
37 struct TESV { // Type for an Element on Station
38  TESV() : s(-1), e(-1) {}
39  TESV(const TES &i) : s(i.s), e(i.e) {}
40  TESV(int_v is, uint_v ie) : s(is), e(ie) {}
41  TESV(uint_v ie, int_v is) : s(is), e(ie) {} // to prevent confusion
42 
43  operator uint_v() const { return e; }
44  TES operator[](int i) const { return TES(s[i], e[i]); }
45  float_m IsValid() const { return static_cast<float_m>(s >= Vc::Zero); }
46 
47  friend float_m operator==(const TESV &a, const TES &b) { return (a.s == static_cast<unsigned int>(b.s)) & (a.e == b.e); }
48 
49  int_v s; // index of station
50  uint_v e; // index of element
51 };
52 
53 #endif
int_v s
Definition: FTSCATES.h:49
TESV(uint_v ie, int_v is)
Definition: FTSCATES.h:41
TES()
Definition: FTSCATES.h:25
Definition: FTSCATES.h:37
unsigned int i
Definition: P4_F32vec4.h:33
TESV(int_v is, uint_v ie)
Definition: FTSCATES.h:40
TES(char is, unsigned int ie)
Definition: FTSCATES.h:26
TES(unsigned int ie, char is)
Definition: FTSCATES.h:27
TES operator[](int i) const
Definition: FTSCATES.h:44
TESV(const TES &i)
Definition: FTSCATES.h:39
uint_v e
Definition: FTSCATES.h:50
char s
Definition: FTSCATES.h:33
friend float_m operator==(const TESV &a, const TES &b)
Definition: FTSCATES.h:47
unsigned int e
Definition: FTSCATES.h:34
friend bool operator!=(const TES &a, const TES &b)
Definition: FTSCATES.h:31
Definition: FTSCATES.h:24
float_m IsValid() const
Definition: FTSCATES.h:45
TESV()
Definition: FTSCATES.h:38