clas12root
Loading...
Searching...
No Matches
ftbparticle.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: ftbparticle.h
9 * Author: dglazier
10 *
11 * Created on April 27, 2017, 10:01 AM
12 */
13
14#ifndef FTBPARTICLE_H
15#define FTBPARTICLE_H
16
17#include <hipo4/bank.h>
18#include <hipo4/dictionary.h>
19#include <memory>
20
21namespace clas12 {
22
23 class ftbparticle : public hipo::bank {
24
25 private:
26
27 int _pid_order{-1};
28 int _vt_order{-1};
29 int _beta_order{-1};
30 int _st_order{-1};
31 int _chi2pid_order{-1};
32 int _px_order{-1};
33 int _py_order{-1};
34 int _pz_order{-1};
35
36 mutable short _entry{0};
37
38 public:
39
40 ftbparticle() = default;
41
42
43 ftbparticle(hipo::dictionary __factory);
44 ftbparticle(hipo::schema __schema);
45
46 ~ftbparticle() override = default;
47
48
49 // void init(const char *bankName, hipo::reader &r);
50 int getPid(int index) const noexcept{ return getInt(_pid_order,index);}
51 float getVt(int index) const noexcept{ return getFloat(_vt_order,index);}
52 float getBeta(int index) const noexcept{ return getFloat(_beta_order,index);}
53 float getChi2Pid(int index) const noexcept{ return getFloat(_chi2pid_order,index);}
54 int getStatus(int index) const noexcept{ return getShort(_st_order,index);}
55 float getPx(int index) const noexcept{ return getFloat(_px_order,index);}
56 float getPy(int index) const noexcept{ return getFloat(_py_order,index);}
57 float getPz(int index) const noexcept{ return getFloat(_pz_order,index);}
58
59 int getPid() const noexcept{ return _entry==-1?0:getInt(_pid_order,_entry);}
60 float getVt() const noexcept{ return _entry==-1?0:getFloat(_vt_order,_entry);}
61 float getBeta() const noexcept{ return _entry==-1?0:getFloat(_beta_order,_entry);}
62 float getChi2Pid() const noexcept{ return _entry==-1?0:getFloat(_chi2pid_order,_entry);}
63 int getStatus() const noexcept{ return _entry==-1?0:getShort(_st_order,_entry);}
64
65 float getPx() const noexcept{ return getFloat(_px_order,_entry);}
66 float getPy() const noexcept{ return getFloat(_py_order,_entry);}
67 float getPz() const noexcept{ return getFloat(_pz_order,_entry);}
68
69
70 void setEntry(short i) const{
71 if( i<getRows() )_entry=i;
72 else _entry = -1;
73 }
74 void setBankEntry(short i){ _entry=i;} //faster for BankHist
75 short getEntry() const noexcept{return _entry;}
81 void notify() final {
82 bank::notify();
83 //printf("ftbparticle class is read again\n");
84 }
85 };
86
88 using ftbpar_uptr=std::unique_ptr<clas12::ftbparticle>;
89
90}
91
92#endif /* UTILS_H */
Definition ftbparticle.h:23
float getBeta(int index) const noexcept
Definition ftbparticle.h:52
float getBeta() const noexcept
Definition ftbparticle.h:61
float getVt(int index) const noexcept
Definition ftbparticle.h:51
float getPz(int index) const noexcept
Definition ftbparticle.h:57
void setBankEntry(short i)
Definition ftbparticle.h:74
float getChi2Pid() const noexcept
Definition ftbparticle.h:62
int getStatus() const noexcept
Definition ftbparticle.h:63
float getPx(int index) const noexcept
Definition ftbparticle.h:55
float getVt() const noexcept
Definition ftbparticle.h:60
void setEntry(short i) const
Definition ftbparticle.h:70
float getChi2Pid(int index) const noexcept
Definition ftbparticle.h:53
~ftbparticle() override=default
short getEntry() const noexcept
Definition ftbparticle.h:75
float getPz() const noexcept
Definition ftbparticle.h:67
float getPx() const noexcept
Definition ftbparticle.h:65
int getPid(int index) const noexcept
Definition ftbparticle.h:50
int getStatus(int index) const noexcept
Definition ftbparticle.h:54
float getPy() const noexcept
Definition ftbparticle.h:66
void notify() final
Definition ftbparticle.h:81
int getPid() const noexcept
Definition ftbparticle.h:59
float getPy(int index) const noexcept
Definition ftbparticle.h:56
Definition calextras.cpp:10
clas12::ftbparticle * ftbpar_ptr
Definition ftbparticle.h:87
std::unique_ptr< clas12::ftbparticle > ftbpar_uptr
Definition ftbparticle.h:88