forked from DeepLearnPhysics/Supera
-
Notifications
You must be signed in to change notification settings - Fork 1
/
SuperaMCParticle.h
113 lines (87 loc) · 2.84 KB
/
SuperaMCParticle.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
/**
* \file SuperaMCParticle.h
*
* \ingroup Package_Name
*
* \brief Class def header for a class SuperaMCParticle
*
* @author kazuhiro
*/
/** \addtogroup Package_Name
@{*/
#ifndef __SUPERAMCPARTICLE_H__
#define __SUPERAMCPARTICLE_H__
//#ifndef __CINT__
//#ifndef __CLING__
#include "SuperaBase.h"
#include "FMWKInterface.h"
#include "MCParticleTree.h"
#include "MCParticleHelper.h"
#include "larcv/core/DataFormat/Voxel3DMeta.h"
namespace larcv {
/**
\class ProcessBase
User defined class SuperaMCParticle ... these comments are used to generate
doxygen documentation!
*/
class SuperaMCParticle : public SuperaBase {
public:
/// Default constructor
SuperaMCParticle(const std::string name = "SuperaMCParticle");
/// Default destructor
~SuperaMCParticle() {}
void configure(const PSet&);
void initialize();
bool process(IOManager& mgr);
void finalize();
//bool StoreG4SecondaryParticle() const { return _store_g4_secondary_roi; }
//bool StoreG4PrimaryParticle() const { return _store_g4_primary_roi; }
//const std::vector<std::pair<size_t, size_t> >& Particle2MCNode(int roi_index) const;
//const std::vector<std::vector<std::pair<size_t, size_t> > >&
//Particle2MCNode() const { return _roi2mcnode_vv; }
const supera::MCParticleTree& ParticleTree() const { return _mcpt; }
private:
//bool _store_part;
//bool _store_g4_primary_part;
//bool _store_g4_secondary_part;
bool _store_pixel2d;
bool _store_voxel3d;
std::vector<larcv::Particle> _part_v;
supera::MCParticleTree _mcpt;
supera::MCParticleHelper _mcpart_maker;
//std::vector<std::vector<std::pair<size_t, size_t> > > _part2mcnode_vv;
unsigned short _pass_origin;
std::vector<int> _filter_pdg;
std::vector<double> _filter_min_einit;
std::vector<double> _filter_min_edep;
double _shower_min_einit;
double _shower_min_edep;
double _track_min_einit;
double _track_min_edep;
std::string _output_label;
std::string _ref_meta3d_cluster3d;
std::string _ref_meta3d_tensor3d;
//size_t _filter_min_cols;
//size_t _filter_min_rows;
bool FilterNode(const supera::MCNode& node) const;
larcv::Particle MakeParticle(const supera::MCNode& node,
const larcv::Voxel3DMeta& meta) const;
};
/**
\class larcv::SuperaMCParticleFactory
\brief A concrete factory class for larcv::SuperaMCParticle
*/
class SuperaMCParticleProcessFactory : public ProcessFactoryBase {
public:
/// ctor
SuperaMCParticleProcessFactory() { ProcessFactory::get().add_factory("SuperaMCParticle", this); }
/// dtor
~SuperaMCParticleProcessFactory() {}
/// creation method
ProcessBase* create(const std::string instance_name) { return new SuperaMCParticle(instance_name); }
};
}
//#endif
//#endif
#endif
/** @} */ // end of doxygen group