PandaRoot
PndCATES.h
Go to the documentation of this file.
1 //-*- Mode: C++ -*-
2 // *****************************************************************************
3 // *
4 // @Autors: I.Kulakov; M.Zyzak; I.Kisel *
5 // @e-mail: I.Kulakov@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de *
6 // *
7 // *****************************************************************************
8 
9 #ifndef PNDCATES_H
10 #define PNDCATES_H
11 
12 struct PndCATES { // Type for an Element on Station
13  PndCATES() : s(-1), e(-1) {}
14  PndCATES(char is, unsigned int ie) : s(is), e(ie) {}
15  PndCATES(unsigned short int ie, char is) : s(is), e(ie) {} // to prevent confusion
16 
17  operator unsigned int() { return e; }
18 
19  friend bool operator!=(const PndCATES &a, const PndCATES &b) { return (a.s != b.s) || (a.e != b.e); }
20 
21  char s; // index of station
22  unsigned int e; // index of element
23 };
24 
25 struct PndCATESV { // Type for an Element on Station
26  PndCATESV() : s(-1), e(-1) {}
27  PndCATESV(const PndCATES &i) : s(i.s), e(i.e) {}
28  PndCATESV(int_v is, uint_v ie) : s(is), e(ie) {}
29  PndCATESV(uint_v ie, int_v is) : s(is), e(ie) {} // to prevent confusion
30 
31  operator uint_v() const { return e; }
32  PndCATES operator[](int i) const { return PndCATES(s[i], e[i]); }
33  float_m IsValid() const { return static_cast<float_m>(s >= Vc::Zero); }
34 
35  friend float_m operator==(const PndCATESV &a, const PndCATES &b) { return (a.s == static_cast<unsigned int>(b.s)) & (a.e == b.e); }
36 
37  int_v s; // index of station
38  uint_v e; // index of element
39 };
40 
41 #endif
friend bool operator!=(const PndCATES &a, const PndCATES &b)
Definition: PndCATES.h:19
char s
Definition: PndCATES.h:21
unsigned int i
Definition: P4_F32vec4.h:21
friend float_m operator==(const PndCATESV &a, const PndCATES &b)
Definition: PndCATES.h:35
PndCATES(unsigned short int ie, char is)
Definition: PndCATES.h:15
float_m IsValid() const
Definition: PndCATES.h:33
int_v s
Definition: PndCATES.h:37
PndCATESV(const PndCATES &i)
Definition: PndCATES.h:27
uint_v e
Definition: PndCATES.h:38
PndCATES(char is, unsigned int ie)
Definition: PndCATES.h:14
PndCATESV(int_v is, uint_v ie)
Definition: PndCATES.h:28
PndCATESV(uint_v ie, int_v is)
Definition: PndCATES.h:29
PndCATESV()
Definition: PndCATES.h:26
PndCATES()
Definition: PndCATES.h:13
PndCATES operator[](int i) const
Definition: PndCATES.h:32
unsigned int e
Definition: PndCATES.h:22