clas12root
Loading...
Searching...
No Matches
mcevent.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: mcevent.h
9 * Author: dglazier
10 *
11 */
12
13#ifndef MCEVENT_H
14#define MCEVENT_H
15
16#include <hipo4/bank.h>
17#include <cmath>
18#include <memory>
19
20namespace clas12 {
21
22 class mcevent : public hipo::bank {
23
24
25 public:
26
27 mcevent() = default;
28
29 mcevent(hipo::schema __schema);
30
31 virtual ~mcevent() = default;
32
33
34
35 int getNpart() const noexcept { return getShort(_npart_order,_entry);}
36 int getAtarget() const noexcept { return getShort(_atarget_order,_entry);}
37 int getZtarget() const noexcept { return getShort(_ztarget_order,_entry);}
38 float getPtarget() const noexcept { return getFloat(_ptarget_order,_entry);}
39 float getPbeam() const noexcept { return getFloat(_pbeam_order,_entry);}
40 float getEbeam() const noexcept { return getFloat(_ebeam_order,_entry);}
41 int getBtype() const noexcept { return getShort(_btype_order,_entry);}
42 int getTargetid() const noexcept { return getShort(_targetid_order,_entry);}
43 int getProcessid() const noexcept { return getShort(_processid_order,_entry);}
44 float getWeight() const noexcept { return getFloat(_weight_order,_entry);}
45
46
47 //void setEntry(short i){ _entry=i;}
48 // void setBankEntry(short i){ _entry=i;} //faster for BankHist
49 short getEntry() const noexcept{return _entry;}
55 void notify() final {
56 bank::notify();
57 }
58
59 private:
60
61 int _npart_order{-1};
62 int _atarget_order{-1};
63 int _ztarget_order{-1};
64 int _ptarget_order{-1};
65 int _pbeam_order{-1};
66 int _btype_order{-1};
67 int _ebeam_order{-1};
68 int _targetid_order{-1};
69 int _processid_order{-1};
70 int _weight_order{-1};
71
72
73
74 short _entry={0};
75
76 };
77
79 using mcevt_uptr=std::unique_ptr<clas12::mcevent>;
80
81}
82
83#endif /* UTILS_H */
Definition mcevent.h:22
mcevent()=default
float getPbeam() const noexcept
Definition mcevent.h:39
float getPtarget() const noexcept
Definition mcevent.h:38
float getEbeam() const noexcept
Definition mcevent.h:40
int getAtarget() const noexcept
Definition mcevent.h:36
int getTargetid() const noexcept
Definition mcevent.h:42
int getBtype() const noexcept
Definition mcevent.h:41
void notify() final
Definition mcevent.h:55
virtual ~mcevent()=default
int getProcessid() const noexcept
Definition mcevent.h:43
int getZtarget() const noexcept
Definition mcevent.h:37
short getEntry() const noexcept
Definition mcevent.h:49
int getNpart() const noexcept
Definition mcevent.h:35
float getWeight() const noexcept
Definition mcevent.h:44
Definition calextras.cpp:10
clas12::mcevent * mcevt_ptr
Definition mcevent.h:78
std::unique_ptr< clas12::mcevent > mcevt_uptr
Definition mcevent.h:79