forked from kvtsang/Supera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MCParticleHelper.h
104 lines (78 loc) · 3.7 KB
/
MCParticleHelper.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
#ifndef __SUPERA_MCPARTICLEHELPER_H__
#define __SUPERA_MCPARTICLEHELPER_H__
//#ifndef __CINT__
//#ifndef __CLING__
#include <vector>
// LArSoft
//#include "MCBase/MCTrack.h"
//#include "MCBase/MCShower.h"
//#include "Simulation/SimChannel.h"
//#include "SimulationBase/MCParticle.h"
// LArCV
#include "larcv/core/Base/larcv_base.h"
#include "larcv/core/DataFormat/Particle.h"
#include "larcv/core/DataFormat/BBox.h"
#include "larcv/core/DataFormat/Voxel3DMeta.h"
#include "FMWKInterface.h"
#include "Range.h"
namespace supera {
typedef ::larcv::Range<unsigned int> WTRange_t;
typedef std::vector<supera::WTRange_t> WTRangeArray_t;
class MCParticleHelper : public ::larcv::larcv_base {
public:
MCParticleHelper() : larcv::larcv_base("MCParticleHelper")
, _max_time_tick(9600)
, _time_padding(10)
, _wire_padding(10)
{}
virtual ~MCParticleHelper() {}
void configure(const supera::Config_t& cfg);
/**
Given single MCTrack, returns length 4 range array (3 planes + time) \n
which contains all trajectory points of input MCTrack.
*/
WTRangeArray_t WireTimeBoundary( const supera::LArMCTrack_t& mct ) const;
WTRangeArray_t WireTimeBoundary( const supera::LArMCTrack_t& mct,
const std::vector<supera::LArSimCh_t>& sch_v ) const;
WTRangeArray_t WireTimeBoundary( const supera::LArMCShower_t& mcs ) const;
WTRangeArray_t WireTimeBoundary( const supera::LArMCShower_t& mcs,
const std::vector<supera::LArSimCh_t>& sch_v ) const;
std::vector<larcv::BBox2D> MakeBBox2D( const supera::LArMCTrack_t& mct,
const int time_offset ) const;
std::vector<larcv::BBox2D> MakeBBox2D( const supera::LArMCTrack_t& mct,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset ) const;
std::vector<larcv::BBox2D> MakeBBox2D( const supera::LArMCShower_t& mcs,
const int time_offset ) const;
std::vector<larcv::BBox2D> MakeBBox2D( const supera::LArMCShower_t& mcs,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset ) const;
::larcv::Particle MakeParticle( const supera::LArMCTrack_t& mct) const;
::larcv::Particle MakeParticle( const supera::LArMCTrack_t& mct,
const larcv::Voxel3DMeta& meta3d) const;
::larcv::Particle MakeParticle( const supera::LArMCShower_t& mcs) const;
::larcv::Particle MakeParticle( const supera::LArMCTrack_t& mct,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset) const;
::larcv::Particle MakeParticle( const supera::LArMCShower_t& mcs,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset ) const;
::larcv::Particle MakeParticle( const supera::LArMCTrack_t& mct,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset,
const larcv::Voxel3DMeta& meta3d) const;
::larcv::Particle MakeParticle( const supera::LArMCShower_t& mcs,
const std::vector<supera::LArSimCh_t>& sch_v,
const int time_offset,
const larcv::Voxel3DMeta& meta3d) const;
private:
std::vector<larcv::BBox2D> WTRange2BB(const WTRangeArray_t&) const;
unsigned int _max_time_tick; ///< Maximum tick number in time
unsigned int _time_padding; ///< Padding in time axis (height) for MCParticleHelper::Format function
unsigned int _wire_padding; ///< Padding in wire axis (width) for MCParticleHelper::Format function
bool _apply_sce;
};
}
#endif
//#endif
//#endif