PandaRoot
PndCATES.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.Zyzak; I.Kisel *
17 // @e-mail: I.Kulakov@gsi.de; M.Zyzak@gsi.de; I.Kisel@compeng.uni-frankfurt.de *
18 // *
19 // *****************************************************************************
20 
21 #ifndef PNDCATES_H
22 #define PNDCATES_H
23 
24 struct PndCATES { // Type for an Element on Station
25  PndCATES() : s(-1), e(-1) {}
26  PndCATES(char is, unsigned int ie) : s(is), e(ie) {}
27  PndCATES(unsigned short int ie, char is) : s(is), e(ie) {} // to prevent confusion
28 
29  operator unsigned int() { return e; }
30 
31  friend bool operator!=(const PndCATES &a, const PndCATES &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 PndCATESV { // Type for an Element on Station
38  PndCATESV() : s(-1), e(-1) {}
39  PndCATESV(const PndCATES &i) : s(i.s), e(i.e) {}
40  PndCATESV(int_v is, uint_v ie) : s(is), e(ie) {}
41  PndCATESV(uint_v ie, int_v is) : s(is), e(ie) {} // to prevent confusion
42 
43  operator uint_v() const { return e; }
44  PndCATES operator[](int i) const { return PndCATES(s[i], e[i]); }
45  float_m IsValid() const { return static_cast<float_m>(s >= Vc::Zero); }
46 
47  friend float_m operator==(const PndCATESV &a, const PndCATES &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
friend bool operator!=(const PndCATES &a, const PndCATES &b)
Definition: PndCATES.h:31
char s
Definition: PndCATES.h:33
unsigned int i
Definition: P4_F32vec4.h:33
friend float_m operator==(const PndCATESV &a, const PndCATES &b)
Definition: PndCATES.h:47
PndCATES(unsigned short int ie, char is)
Definition: PndCATES.h:27
float_m IsValid() const
Definition: PndCATES.h:45
int_v s
Definition: PndCATES.h:49
PndCATESV(const PndCATES &i)
Definition: PndCATES.h:39
uint_v e
Definition: PndCATES.h:50
PndCATES(char is, unsigned int ie)
Definition: PndCATES.h:26
PndCATESV(int_v is, uint_v ie)
Definition: PndCATES.h:40
PndCATESV(uint_v ie, int_v is)
Definition: PndCATES.h:41
PndCATESV()
Definition: PndCATES.h:38
PndCATES()
Definition: PndCATES.h:25
PndCATES operator[](int i) const
Definition: PndCATES.h:44
unsigned int e
Definition: PndCATES.h:34