clas12root
Loading...
Searching...
No Matches
scintillator.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: scintillator.h
9 * Author: dglazier
10 *
11 * Created on April 27, 2017, 10:01 AM
12 */
13
14#ifndef CLAS12_SCINTILLATOR_H
15#define CLAS12_SCINTILLATOR_H
16
17#include "particle_detector.h"
18#include "scintextras.h"
19
20
21namespace clas12 {
22
24
25
26 public:
27
28
29 scintillator()=default;
30
31 scintillator(hipo::schema aschema);
32 scintillator(hipo::schema aschema,hipo::schema extras);
33
34 ~scintillator() override=default;
35
36 int getLayer(int index) const noexcept override{
37 if(index>-1)return getByte(_layer_order,index);
38 return 0;
39 }
40 //getter funtions for items in scintillator bank
41 int getComponent() const noexcept{
42 if(_index>-1)return getShort(_component_order,_index);
43 return 0;
44 }
45 double getTime() const noexcept{
46 if(_index>-1)return getFloat(_time_order,_index);
47 return 0;
48 }
49 double getEnergy() const noexcept{
50 if(_index>-1)return getFloat(_energy_order,_index);
51 return 0;
52 }
53 double getPath() const noexcept{
54 if(_index>-1)return getFloat(_path_order,_index);
55 return 0;
56 }
57 int getSector() const noexcept{
58 if(_index>-1)return getByte(_sector_order,_index);
59 return 0;
60 }
61 int getStatus() const noexcept{
62 if(_index>-1)return getShort(_status_order,_index);
63 return 0;
64 }
65 int getLayer() const noexcept override{
66 if(_index>-1)return getByte(_layer_order,_index);
67 return 0;
68 }
69 double getX() const noexcept{
70 if(_index>-1)return getFloat(_x_order,_index);
71 return 0;
72 }
73 double getY() const noexcept{
74 if(_index>-1)return getFloat(_y_order,_index);
75 return 0;
76 }
77 double getZ() const noexcept{
78 if(_index>-1)return getFloat(_z_order,_index);
79 return 0;
80 }
81 double getHX() const noexcept{
82 if(_index>-1)return getFloat(_hx_order,_index);
83 return 0;
84 }
85 double getHY() const noexcept{
86 if(_index>-1)return getFloat(_hy_order,_index);
87 return 0;
88 }
89 double getHZ() const noexcept{
90 if(_index>-1)return getFloat(_hz_order,_index);
91 return 0;
92 }
93 double getChi2() const noexcept{
94 if(_index>-1)return getFloat(_chi2_order,_index);
95 return 0;
96 }
97
98
99 //get extras
100 double getDedx() const noexcept{
101 return _extras.get()!=nullptr ? _extras->getDedx(_index):0;
102 }
103 int getSize() const noexcept{
104 return _extras.get()!=nullptr ? _extras->getSize(_index):0;
105 }
106 int getLayermulti() const noexcept{
107 return _extras.get()!=nullptr ? _extras->getLayermulti(_index):0;
108 }
109
110 scintextras* getExtras()const {return _extras.get();}
111
112 private:
113
114 int _layer_order=-1;
115 int _component_order=-1;
116 int _energy_order=-1;
117 int _path_order=-1;
118 int _time_order=-1;
119 int _sector_order=-1;
120 int _status_order=-1;
121 int _x_order=-1;
122 int _y_order=-1;
123 int _z_order=-1;
124 int _hx_order=-1;
125 int _hy_order=-1;
126 int _hz_order=-1;
127 int _chi2_order=-1;
128
129 scintextra_uptr _extras;
130
131 }; //class scintillator
132
134 using scint_uptr=std::unique_ptr<clas12::scintillator>;
135
136}//namespace clas12
137
138#endif /* UTILS_H */
int _index
Definition particle_detector.h:83
Definition scintextras.h:26
Definition scintillator.h:23
double getTime() const noexcept
Definition scintillator.h:45
int getLayermulti() const noexcept
Definition scintillator.h:106
double getEnergy() const noexcept
Definition scintillator.h:49
double getChi2() const noexcept
Definition scintillator.h:93
double getHY() const noexcept
Definition scintillator.h:85
double getX() const noexcept
Definition scintillator.h:69
int getSector() const noexcept
Definition scintillator.h:57
double getHX() const noexcept
Definition scintillator.h:81
int getLayer() const noexcept override
Definition scintillator.h:65
scintextras * getExtras() const
Definition scintillator.h:110
int getComponent() const noexcept
Definition scintillator.h:41
double getDedx() const noexcept
Definition scintillator.h:100
double getHZ() const noexcept
Definition scintillator.h:89
int getSize() const noexcept
Definition scintillator.h:103
int getStatus() const noexcept
Definition scintillator.h:61
double getPath() const noexcept
Definition scintillator.h:53
double getZ() const noexcept
Definition scintillator.h:77
~scintillator() override=default
double getY() const noexcept
Definition scintillator.h:73
int getLayer(int index) const noexcept override
Definition scintillator.h:36
Definition calextras.cpp:10
std::unique_ptr< clas12::scintillator > scint_uptr
Definition scintillator.h:134
std::unique_ptr< clas12::scintextras > scintextra_uptr
Definition scintextras.h:83
clas12::scintillator * scint_ptr
Definition scintillator.h:133