Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
srcs
sbnana
sbnanalysis
ana
SBNOscReco
NumuReco
PrimaryTrack.cc
Go to the documentation of this file.
1
#include "
PrimaryTrack.h
"
2
3
int
numu::SelectLongestTrack
(
const
std::map<size_t, numu::RecoTrack> &
tracks
,
const
numu::RecoSlice
&slice) {
4
if
(slice.
primary_index
< 0)
return
-1;
5
6
const
numu::RecoParticle
&neutrino = slice.
particles
.at(slice.
primary_index
);
7
double
max_len = -1.;
8
int
ret = -1;
9
for
(
size_t
pfp_index: neutrino.
daughters
) {
10
const
numu::RecoParticle
&daughter = slice.
particles
.at(pfp_index);
11
if
(tracks.count(daughter.
ID
)) {
12
if
(ret < 0 || tracks.at(daughter.
ID
).length > max_len) {
13
max_len = tracks.at(daughter.
ID
).length;
14
ret = daughter.
ID
;
15
}
16
}
17
}
18
19
return
ret;
20
}
21
22
int
numu::SelectLongestIDdMuon
(
const
std::map<size_t, numu::RecoTrack> &
tracks
,
const
numu::RecoSlice
&slice) {
23
if
(slice.
primary_index
< 0)
return
-1;
24
25
const
numu::RecoParticle
&neutrino = slice.
particles
.at(slice.
primary_index
);
26
double
max_len = -1.;
27
int
ret = -1;
28
for
(
size_t
pfp_index: neutrino.
daughters
) {
29
const
numu::RecoParticle
&daughter = slice.
particles
.at(pfp_index);
30
if
(tracks.count(daughter.
ID
)) {
31
const
numu::RecoTrack
&
track
= tracks.at(daughter.
ID
);
32
// muon ID: exiting or chi2 hypothesis smaller than proton
33
if
(!track.
is_contained
|| track.
chi2_muon
< track.
chi2_proton
) {
34
if
(ret < 0 || track.length > max_len) {
35
max_len = track.
length
;
36
ret = daughter.
ID
;
37
}
38
}
39
}
40
}
41
42
return
ret;
43
}
44
numu::RecoTrack::is_contained
bool is_contained
is it contained in the "containment volume"?
Definition:
RecoTrack.h:52
numu::RecoTrack::chi2_muon
float chi2_muon
Chi2 of dE/dx to muon hypotheis. Combined agaisnt all planes.
Definition:
RecoTrack.h:43
tracks
ClusterModuleLabel join with tracks
Definition:
trackfinderalgorithms.fcl:56
numu::RecoTrack
Definition:
RecoTrack.h:32
track
process_name use argoneut_mc_hitfinder track
Definition:
standard_reco.fcl:36
numu::RecoParticle::ID
size_t ID
ID of particle.
Definition:
RecoParticle.h:18
numu::RecoParticle::daughters
std::vector< size_t > daughters
Daughters of the particle in the "particle flow". Value represents index into pandora information...
Definition:
RecoParticle.h:17
PrimaryTrack.h
numu::RecoTrack::length
float length
Length of track.
Definition:
RecoTrack.h:48
numu::SelectLongestIDdMuon
int SelectLongestIDdMuon(const std::map< size_t, RecoTrack > &tracks, const RecoSlice &slice)
Definition:
PrimaryTrack.cc:22
numu::SelectLongestTrack
int SelectLongestTrack(const std::map< size_t, RecoTrack > &tracks, const RecoSlice &slice)
Definition:
PrimaryTrack.cc:3
numu::RecoParticle
Definition:
RecoParticle.h:12
numu::RecoSlice::particles
std::map< size_t, RecoParticle > particles
Map of particle index to particle information.
Definition:
RecoEvent.h:28
numu::RecoSlice::primary_index
int primary_index
Index of the primary particle of this slice.
Definition:
RecoEvent.h:25
numu::RecoSlice
Definition:
RecoEvent.h:24
numu::RecoTrack::chi2_proton
float chi2_proton
Chi2 of dE/dx to proton hypothesis. Combined against all planes.
Definition:
RecoTrack.h:40
Generated by
1.8.5