clas12root
Loading...
Searching...
No Matches
scintextras.h
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: scintextras.h
9 * Author: dglazier
10 *
11 * Created on April 27, 2017, 10:01 AM
12 */
13
14#ifndef CLAS12_SCINTEXTRAS_H
15#define CLAS12_SCINTEXTRAS_H
16
17#include <hipo4/bank.h>
18#include <memory>
19//#include "scintillator.h"
20
21
22namespace clas12 {
23
24 class scintillator;
25
26 class scintextras : public hipo::bank {
27
28
29 public:
30
31
32 scintextras()=default;
33
34 scintextras(hipo::schema __schema);
35
36 ~scintextras() override=default;
37
38
39 double getDedx() const noexcept{
40 if(_index>-1)return getFloat(_dedx_order,_index);
41 return 0.;
42 }
43 int getSize() const noexcept{
44 if(_index>-1)return getShort(_size_order,_index);
45 return 0;
46 }
47 int getLayermulti() const noexcept{
48 if(_index>-1)return getByte(_layermulti_order,_index);
49 return 0;
50 }
51
52 double getDedx(int index) const noexcept{
53 if(index>-1)return getFloat(_dedx_order,index);
54 return 0.;
55 }
56 int getSize(int index) const noexcept{
57 if(index>-1)return getShort(_size_order,index);
58 return 0;
59 }
60 int getLayermulti(int index) const noexcept{
61 if(index>-1)return getByte(_layermulti_order,index);
62 return 0;
63 }
64
65
66 void setBankEntry(short i){ _index=i;} //faster for BankHist
67
68 private:
69 friend scintillator;
70
71 void setIndex(short i){ _index=i;}
72
73
74 int _dedx_order=-1;
75 int _size_order=-1;
76 int _layermulti_order=-1;
77
78 int _index=-1;
79
80 }; //class scintextras
81
83 using scintextra_uptr=std::unique_ptr<clas12::scintextras>;
84
85}//namespace clas12
86
87#endif /* UTILS_H */
Definition scintextras.h:26
int getLayermulti(int index) const noexcept
Definition scintextras.h:60
int getSize(int index) const noexcept
Definition scintextras.h:56
~scintextras() override=default
void setBankEntry(short i)
Definition scintextras.h:66
double getDedx(int index) const noexcept
Definition scintextras.h:52
int getSize() const noexcept
Definition scintextras.h:43
int getLayermulti() const noexcept
Definition scintextras.h:47
double getDedx() const noexcept
Definition scintextras.h:39
Definition scintillator.h:23
Definition calextras.cpp:10
clas12::scintextras * scintextra_ptr
Definition scintextras.h:82
std::unique_ptr< clas12::scintextras > scintextra_uptr
Definition scintextras.h:83