1
/* This file is part of MAUS: http:// micewww.pp.rl.ac.uk:8080/projects/maus
3
* MAUS is free software: you can redistribute it and/or modify
4
* it under the terms of the GNU General Public License as published by
5
* the Free Software Foundation, either version 3 of the License, or
6
* (at your option) any later version.
8
* MAUS is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with MAUS. If not, see <http:// www.gnu.org/licenses/>.
20
#ifndef COMMON_CPP_DATASTRUCTUREHELPER_HH
21
#define COMMON_CPP_DATASTRUCTUREHELPER_HH
27
#include "TLorentzVector.h"
29
#include "src/common_cpp/Recon/Global/Detector.hh"
30
#include "src/common_cpp/DataStructure/Primary.hh"
31
#include "src/common_cpp/DataStructure/Global/PrimaryChain.hh"
32
#include "src/common_cpp/DataStructure/Global/ReconEnums.hh"
33
#include "src/common_cpp/DataStructure/Global/TrackPoint.hh"
34
#include "src/common_cpp/Optics/PhaseSpaceVector.hh"
35
#include "src/common_cpp/Simulation/MAUSPrimaryGeneratorAction.hh"
40
namespace GlobalDS = ::MAUS::DataStructure::Global;
45
class DataStructureHelper {
47
~DataStructureHelper() { }
48
static const DataStructureHelper& GetInstance();
49
std::vector<const MiceModule *> FindModulesByName(const MiceModule * module,
50
std::string name) const;
51
double GetDetectorZPosition(const GlobalDS::DetectorPoint detector_id) const;
52
void GetDetectorAttributes(const Json::Value& json_document,
53
DetectorMap& detectors)
55
std::vector<MAUS::DataStructure::Global::PrimaryChain*>*
56
GetPrimaryChains(const Json::Value& recon_event) const;
57
MAUS::PhaseSpaceVector TrackPoint2PhaseSpaceVector(
58
const MAUS::DataStructure::Global::TrackPoint& track_point) const;
59
MAUS::DataStructure::Global::TrackPoint PhaseSpaceVector2TrackPoint(
60
const MAUS::PhaseSpaceVector& vector,
62
const MAUS::DataStructure::Global::PID particle_id) const;
63
MAUS::Primary PGParticle2Primary(
64
MAUS::MAUSPrimaryGeneratorAction::PGParticle& pgparticle) const;
67
void GetGlobalRawTracks(const Json::Value& recon_event,
68
const DetectorMap& detectors,
69
std::vector<MAUS::recon::global::Track>& raw_tracks);
70
void GetGlobalTracks(const Json::Value& recon_event,
71
const DetectorMap& detectors,
72
std::vector<MAUS::recon::global::Track>& raw_tracks);
73
void GetGlobalTracks(const Json::Value& recon_event,
74
const std::string& json_node_name,
75
const DetectorMap& detectors,
76
std::vector<MAUS::recon::global::Track>& raw_tracks);
78
Json::Value TrackToJson(const MAUS::recon::global::Track& track);
79
GlobalTrackPoint TrackPointToGlobalTrackPoint(
80
const MAUS::recon::global::TrackPoint& track_point);
81
GlobalTrackPoint TrackPointToGlobalTrackPoint(
82
const MAUS::recon::global::TrackPoint& track_point,
83
const bool on_mass_shell);
86
DataStructureHelper() { }
87
CovarianceMatrix GetJsonCovarianceMatrix(
88
const Json::Value& value) const;