forked from DeepLearnPhysics/Supera
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathSuperaMCParticleCluster.h
132 lines (116 loc) · 4.52 KB
/
SuperaMCParticleCluster.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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/**
* \file SuperaMCParticleCluster.h
*
* \ingroup Package_Name
*
* \brief Class def header for a class SuperaMCParticleCluster
*
* @author kazuhiro
*/
/** \addtogroup Package_Name
@{*/
#ifndef __SUPERAMCPARTICLECLUSTER_H__
#define __SUPERAMCPARTICLECLUSTER_H__
//#ifndef __CINT__
//#ifndef __CLING__
#include "SuperaBase.h"
#include "SuperaTrue2RecoVoxel3D.h"
#include "FMWKInterface.h"
#include "MCParticleList.h"
#include "larcv/core/DataFormat/Voxel3DMeta.h"
#include "larcv/core/DataFormat/Voxel.h"
#include "larcv/core/DataFormat/Particle.h"
#include "SuperaMCParticleClusterData.h"
namespace larcv {
/**
\class ProcessBase
User defined class SuperaMCParticleCluster ... these comments are used to generate
doxygen documentation!
*/
class SuperaMCParticleCluster : public SuperaBase {
public:
/// Default constructor
SuperaMCParticleCluster(const std::string name = "SuperaMCParticleCluster");
/// Default destructor
~SuperaMCParticleCluster() {}
void configure(const PSet&);
void initialize();
bool process(IOManager& mgr);
void finalize();
larcv::Particle MakeParticle(const supera::LArMCParticle_t& larmcp);
bool IsTouching(const Voxel3DMeta& meta, const VoxelSet& vs1, const VoxelSet& vs2) const;
bool IsTouching2D(const ImageMeta& meta, const VoxelSet& vs1, const VoxelSet& vs2) const;
std::vector<supera::ParticleGroup> CreateParticleGroups();
void AnalyzeSimEnergyDeposit(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v,
larcv::IOManager& mgr);
void AnalyzeSimChannel(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v,
larcv::IOManager& mgr);
void AnalyzeFirstLastStep(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerTouchingLEScatter(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerIonizations(std::vector<supera::ParticleGroup>& part_grp_v);
void ApplyEnergyThreshold(std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerConversion(std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerFamilyTouching(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerTouching(const larcv::Voxel3DMeta& meta,
std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerTouching2D(std::vector<supera::ParticleGroup>& part_grp_v);
void MergeShowerDeltas(std::vector<supera::ParticleGroup>& part_grp_v);
void DumpHierarchy(size_t trackid,
const std::vector<supera::ParticleGroup>& part_grp_v) const;
std::vector<unsigned int> ParentTrackIDs(size_t trackid) const;
std::vector<unsigned int> ParentShowerTrackIDs(size_t trackid,
const std::vector<supera::ParticleGroup>& part_grp_v,
bool include_lescatter=false) const;
private:
int plane_index(unsigned int cryo_id, unsigned int tpc_id, unsigned int plane_id);
size_t SemanticPriority(size_t a, size_t b) const;
size_t _touch_threshold,_touch_threshold2d;
supera::MCParticleList _mcpl;
SuperaTrue2RecoVoxel3D* _true2reco;
std::string _ref_meta3d_cluster3d;
std::string _ref_meta3d_tensor3d;
std::string _ref_meta2d_tensor2d;
std::string _output_label;
std::string _masked_true2reco_cluster3d;
std::string _masked_true_tensor3d;
bool _use_sed_points;
bool _store_dedx;
size_t _eioni_size;
size_t _delta_size;
size_t _compton_size;
double _compton_energy;
double _edep_threshold;
bool _use_true_pos;
bool _use_sed;
bool _check_particle_validity;
int _projection_id;
bool _merge_shower_delta;
larcv::BBox3D _world_bounds;
std::vector<std::vector<std::vector<int> > > _scan;
std::vector<size_t> _semantic_priority;
size_t _valid_nplanes;
std::vector<larcv::ImageMeta> _meta2d_v;
};
/**
\class larcv::SuperaMCParticleClusterFactory
\brief A concrete factory class for larcv::SuperaMCParticleCluster
*/
class SuperaMCParticleClusterProcessFactory : public ProcessFactoryBase {
public:
/// ctor
SuperaMCParticleClusterProcessFactory() { ProcessFactory::get().add_factory("SuperaMCParticleCluster", this); }
/// dtor
~SuperaMCParticleClusterProcessFactory() {}
/// creation method
ProcessBase* create(const std::string instance_name) { return new SuperaMCParticleCluster(instance_name); }
};
}
//#endif
//#endif
#endif
/** @} */ // end of doxygen group