clas12root
Loading...
Searching...
No Matches
mcmatch.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: mcmatch.h
9 * Author: dglazier
10 *
11 */
12
13#ifndef MCMATCH_H
14#define MCMATCH_H
15
16#include <hipo4/bank.h>
17#include <cmath>
18#include <memory>
19
20namespace clas12 {
21
22 class mcmatch : public hipo::bank {
23
24
25 public:
26
27 mcmatch() = default;
28
29 mcmatch(hipo::schema __schema);
30
31 ~mcmatch() override = default;
32
33
34 /*
35 "name": "MC::RecMatch",
36 "group": 40,
37 "item" : 6,
38 "info": "Rec::Particle -> MC::Particle matching",
39 "entries": [
40 {"name":"pindex", "type":"S", "info":"REC::Particle index"},
41 {"name":"mcindex", "type":"S", "info":"MC::Particle index"},
42 {"name":"player1", "type":"L", "info":"layers from the 1st set of detectors hit by Recon particle"},
43 {"name":"player2", "type":"L", "info":"layers from the 1st set of detectors hit by Recon particle"},
44 {"name":"mclayer1", "type":"L", "info":"layers from the 1st set of detectors hit by MC particle"},
45 {"name":"mclayer2", "type":"L", "info":"layers from the 2nd set of detectors hit by MC particle"},
46 {"name":"quality", "type":"F", "info":"matching quality parameter"}
47 */
48 //OR
49 /*
50 "name": "MC::GenMatch",
51 "group": 40,
52 "item" : 5,
53 "info": "MC::Particle -> REC::Particle matching",
54 "entries": [
55 {"name":"mcindex", "type":"S", "info":"MC::Particle index"},
56 {"name":"pindex", "type":"S", "info":"REC::Particle index"},
57 {"name":"mclayer1", "type":"L", "info":"layers from the 1st set of detectors hit by MC particle"},
58 {"name":"mclayer2", "type":"L", "info":"layers from the 2nd set of detectors hit by MC particle"},
59 {"name":"player1", "type":"L", "info":"layers from the 1st set of detectors hit by Recon particle"},
60 {"name":"player2", "type":"L", "info":"layers from the 2nd set of detectors hit by Recon particle"},
61 {"name":"quality", "type":"F", "info":"matching quality parameter"}
62 ]
63 */
64 short getMCindex() const noexcept { return getShort(_mcindex_order,_index);}
65 short getPindex() const noexcept { return getShort(_pindex_order,_index);}
66
67 long getPlayer1() const noexcept {return getLong(_player1_order,_index);}
68 long getPlayer2() const noexcept {return getLong(_player2_order,_index);}
69 long getMClayer1() const noexcept {return getLong(_mclayer1_order,_index);}
70 long getMClayer2() const noexcept {return getLong(_mclayer2_order,_index);}
71 float getQuality() const noexcept {return getFloat(_qual_order,_index);}
72
73
74 void setEntry(short i){ _index=i;}
75 void setBankEntry(short i){ _index=i;} //faster for BankHist
76 short getEntry() const noexcept{return _index;}
77
78 int getIndex() const noexcept{return _index;}
79
85 void notify() final {
86 bank::notify();
87 }
88
89
90 short getPindex(int ix) const noexcept { return getShort(_pindex_order,ix);}
91 short getMCindex(int ix) const noexcept { return getShort(_mcindex_order,ix);}
92
93 private:
94
95 int _mcindex_order{-1};
96 int _pindex_order{-1};
97 int _player1_order{-1};
98 int _player2_order{-1};
99 int _mclayer1_order{-1};
100 int _mclayer2_order{-1};
101 int _qual_order{-1};
102
103 // std::vector<int> _rvec{};
104 //std::vector<int> _rmcvec{};
105
106 short _index={0};
107
108 };
109
111 using mcmatch_uptr=std::unique_ptr<clas12::mcmatch>;
112
113}
114
115#endif /* UTILS_H */
Definition mcmatch.h:22
short getMCindex(int ix) const noexcept
Definition mcmatch.h:91
short getMCindex() const noexcept
Definition mcmatch.h:64
~mcmatch() override=default
void setEntry(short i)
Definition mcmatch.h:74
short getPindex(int ix) const noexcept
Definition mcmatch.h:90
long getPlayer1() const noexcept
Definition mcmatch.h:67
void notify() final
Definition mcmatch.h:85
long getMClayer1() const noexcept
Definition mcmatch.h:69
short getPindex() const noexcept
Definition mcmatch.h:65
mcmatch()=default
long getMClayer2() const noexcept
Definition mcmatch.h:70
void setBankEntry(short i)
Definition mcmatch.h:75
float getQuality() const noexcept
Definition mcmatch.h:71
short getEntry() const noexcept
Definition mcmatch.h:76
long getPlayer2() const noexcept
Definition mcmatch.h:68
int getIndex() const noexcept
Definition mcmatch.h:78
Definition calextras.cpp:10
clas12::mcmatch * mcmatch_ptr
Definition mcmatch.h:110
std::unique_ptr< clas12::mcmatch > mcmatch_uptr
Definition mcmatch.h:111