Jpp 21.0.0
the software that should make you happy
Loading...
Searching...
No Matches
reconstruction.cc File Reference
#include "km3net-dataformat/tools/reconstruction.hh"
#include <atomic>
#include <iostream>
#include "km3net-dataformat/tools/meta_utils.hh"

Go to the source code of this file.

Functions

void setup_from_meta_file (const char *filename)
 Setup information from file containing metadata.
 
bool has_all_reco_stages (const Trk &track)
 Test if the track has a full reconstruction chain.
 
bool has_jppmuon_all_reco_stages (const Trk &track)
 Test whether given track has a full jppmuon chain.
 
bool has_jppshower_all_reco_stages (const Trk &track)
 Test whether given track has a full jppshower chain.
 
bool has_aashower_all_reco_stages (const Trk &track)
 Test whether given track has a full aashower chain.
 
bool has_jppmuon_full_fit (const Trk &track)
 Test if track has a full jppmuon fit.
 
bool has_shower_full_fit (const Trk &track)
 Test if the track has a full jppshower fit.
 
bool has_aashower_full_fit (const Trk &track)
 Test if the track has a full aashower fit.
 

Variables

static std::atomic< int > jpp_major_version = 20
 
static const int JPP_VERSION_TRK_STATUS = 18
 

Function Documentation

◆ setup_from_meta_file()

void setup_from_meta_file ( const char * filename)

Setup information from file containing metadata.

Parameters
filenameName of the file containing the metadata

Definition at line 13 of file reconstruction.cc.

14{
15 auto jpp_meta_version = get_jpp_version_from_file(filename);
16 jpp_major_version = get_jpp_major_version(jpp_meta_version);
17 if (jpp_major_version < 0)
18 {
19 std::cout << "Warning: cannot extract the major version from " << jpp_meta_version << ". Assuming this is a recent version" << std::endl;
21 }
22}
std::string get_jpp_version_from_file(const char *filename)
Reads the jpp version from file.
Definition meta_utils.cc:57
int get_jpp_major_version(const std::string &version_str)
Get the jpp major version.
Definition meta_utils.cc:63
static std::atomic< int > jpp_major_version

◆ has_all_reco_stages()

bool has_all_reco_stages ( const Trk & track)

Test if the track has a full reconstruction chain.

Parameters
trackTrack
Returns
True if the reconstruction chain is full

Definition at line 24 of file reconstruction.cc.

25{
26 return track.status == TRK_ST_FINALSTATE;
27}
int status
MC or reconstruction status code, see km3net-dataformat/definitions/trkmembers.csv for values.
Definition Trk.hh:28
static const int TRK_ST_FINALSTATE
for MC: the particle must be processed by detector simulation ('track_in' tag in evt files)....
Definition trkmembers.hh:17

◆ has_jppmuon_all_reco_stages()

bool has_jppmuon_all_reco_stages ( const Trk & track)

Test whether given track has a full jppmuon chain.

Parameters
trackTrack
Returns
True if the reconstruction chain is full

Definition at line 29 of file reconstruction.cc.

30{
31 return jpp_major_version < JPP_VERSION_TRK_STATUS ? (track.rec_stages.size() >= 5 && track.rec_stages.back() == JMUONENERGY) : has_all_reco_stages(track);
32}
bool has_all_reco_stages(const Trk &track)
Test if the track has a full reconstruction chain.
static const int JPP_VERSION_TRK_STATUS
std::vector< int > rec_stages
list of identifiers of successful fitting stages resulting in this track
Definition Trk.hh:26

◆ has_jppshower_all_reco_stages()

bool has_jppshower_all_reco_stages ( const Trk & track)

Test whether given track has a full jppshower chain.

Parameters
trackTrack
Returns
True if the reconstruction chain is full

Definition at line 34 of file reconstruction.cc.

35{
37}

◆ has_aashower_all_reco_stages()

bool has_aashower_all_reco_stages ( const Trk & track)

Test whether given track has a full aashower chain.

Parameters
trackTrack
Returns
True if the reconstruction chain is full

Definition at line 39 of file reconstruction.cc.

40{
42}

◆ has_jppmuon_full_fit()

bool has_jppmuon_full_fit ( const Trk & track)

Test if track has a full jppmuon fit.

Parameters
trackTrack
Returns
True if it has a full jppmuon fit

Definition at line 44 of file reconstruction.cc.

45{
46 return has_jppmuon_fit(track) && has_jppmuon_all_reco_stages(track);
47}
bool has_jppmuon_all_reco_stages(const Trk &track)
Test whether given track has a full jppmuon chain.
bool has_jppmuon_fit(const Trk &track)
Test whether given track has default muon fit in history.

◆ has_shower_full_fit()

bool has_shower_full_fit ( const Trk & track)

Test if the track has a full jppshower fit.

Parameters
trackTrack
Returns
True if the track has a full jppshower fit

Definition at line 49 of file reconstruction.cc.

50{
51 return has_shower_fit(track) && has_jppshower_all_reco_stages(track);
52}
bool has_jppshower_all_reco_stages(const Trk &track)
Test whether given track has a full jppshower chain.
bool has_shower_fit(const Trk &track)
Test whether given track has default shower fit in history.

◆ has_aashower_full_fit()

bool has_aashower_full_fit ( const Trk & track)

Test if the track has a full aashower fit.

Parameters
trackTrack
Returns
True if the track has a full aashower fit

Definition at line 54 of file reconstruction.cc.

55{
56 return has_aashower_fit(track) && has_aashower_all_reco_stages(track);
57}
bool has_aashower_all_reco_stages(const Trk &track)
Test whether given track has a full aashower chain.
bool has_aashower_fit(const Trk &track)
Test whether given track has default shower fit in history.

Variable Documentation

◆ jpp_major_version

std::atomic<int> jpp_major_version = 20
static

Definition at line 8 of file reconstruction.cc.

◆ JPP_VERSION_TRK_STATUS

const int JPP_VERSION_TRK_STATUS = 18
static

Definition at line 11 of file reconstruction.cc.