FairRoot/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 
10 #ifndef PNDCATES_H
11 #define PNDCATES_H
12 
13 struct PndCATES { // Type for an Element on Station
14  PndCATES(): s(-1), e(-1){}
15  PndCATES( char is, unsigned int ie ): s(is), e(ie){}
16  PndCATES( unsigned short int ie, char is ): s(is), e(ie){} // to prevent confusion
17 
18  operator unsigned int() { return e; }
19 
20  friend bool operator!=( const PndCATES& a, const PndCATES& b ) {
21  return (a.s != b.s) || (a.e != b.e);
22  }
23 
24  char s; // index of station
25  unsigned int e; // index of element
26 };
27 
28 struct PndCATESV { // Type for an Element on Station
29  PndCATESV(): s(-1), e(-1){}
30  PndCATESV( const PndCATES& i ): s(i.s), e(i.e){}
31  PndCATESV( int_v is, uint_v ie ): s(is), e(ie){}
32  PndCATESV( uint_v ie, int_v is ): s(is), e(ie){} // to prevent confusion
33 
34  operator uint_v() const { return e; }
35  PndCATES operator[](int i) const { return PndCATES(s[i],e[i]); }
36  float_m IsValid() const { return static_cast<float_m>(s >= Vc::Zero); }
37 
38  friend float_m operator==( const PndCATESV& a, const PndCATES& b ) {
39  return (a.s == static_cast<unsigned int>(b.s)) & (a.e == b.e);
40  }
41 
42  int_v s; // index of station
43  uint_v e; // index of element
44 };
45 
46 
47 
48 #endif
49 
Int_t i
Definition: run_full.C:25
TTree * b
friend bool operator!=(const PndCATES &a, const PndCATES &b)
Definition: PndCATES.h:20
float_m IsValid() const
Definition: PndCATES.h:36
static const fvec Zero
char s
Definition: PndCATES.h:24
friend float_m operator==(const PndCATESV &a, const PndCATES &b)
Definition: PndCATES.h:38
PndCATES(unsigned short int ie, char is)
Definition: PndCATES.h:16
int_v s
Definition: PndCATES.h:42
Int_t a
Definition: anaLmdDigi.C:126
PndCATES operator[](int i) const
Definition: PndCATES.h:35
PndCATESV(const PndCATES &i)
Definition: PndCATES.h:30
uint_v e
Definition: PndCATES.h:43
static int is
Definition: ranlxd.cxx:374
PndCATES(char is, unsigned int ie)
Definition: PndCATES.h:15
PndCATESV(int_v is, uint_v ie)
Definition: PndCATES.h:31
PndCATESV(uint_v ie, int_v is)
Definition: PndCATES.h:32
PndCATESV()
Definition: PndCATES.h:29
PndCATES()
Definition: PndCATES.h:14
unsigned int e
Definition: PndCATES.h:25