~mbogomilov/maus/devel3

« back to all changes in this revision

Viewing changes to src/map/MapCppGlobalRawTracks/MapCppGlobalRawTracks.hh

  • Committer: Durga Rajaram
  • Date: 2014-01-14 04:39:44 UTC
  • mfrom: (663.38.24 merge)
  • mto: (698.1.1 release)
  • mto: This revision was merged to the branch mainline in revision 693.
  • Revision ID: durga@fnal.gov-20140114043944-qf0i8nksnwu74cll
candidate 0.7.6 - trunk r1026

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
 
2
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 *
 
16
 */
 
17
 
 
18
#ifndef _SRC_MAP_MAPCPPGLOBALRAWTRACKS_HH_
 
19
#define _SRC_MAP_MAPCPPGLOBALRAWTRACKS_HH_
 
20
 
 
21
// C++ headers
 
22
#include <string>
 
23
#include <vector>
 
24
#include <map>
 
25
 
 
26
// external libraries
 
27
#include "TMinuit.h"
 
28
 
 
29
// G4MICE from legacy
 
30
#include "Config/MiceModule.hh"
 
31
#include "Interface/Squeak.hh"
 
32
 
 
33
// MAUS
 
34
#include "DataStructure/Global/Track.hh"
 
35
#include "Recon/Global/Detector.hh"
 
36
#include "Recon/Global/Particle.hh"
 
37
 
 
38
namespace MAUS {
 
39
 
 
40
class CovarianceMatrix;
 
41
class GlobalEvent;
 
42
class ReconEvent;
 
43
class TOFSpacePoint;
 
44
class SciFiTrackPoint;
 
45
 
 
46
namespace DataStructure {
 
47
namespace Global {
 
48
  class TrackPoint;
 
49
}
 
50
}
 
51
 
 
52
namespace recon {
 
53
namespace global {
 
54
}  // namespace global
 
55
}  // namespace recon
 
56
 
 
57
/** @class MapCppGlobalRawTracks
 
58
 *  Reconstruct tracks at the desired longitudinal spacing using the desired
 
59
 *  track fitting method.
 
60
 */
 
61
class MapCppGlobalRawTracks {
 
62
 public:
 
63
  /** @brief Allocates the global-scope Minuit instance used for minimization.
 
64
   */
 
65
  MapCppGlobalRawTracks();
 
66
 
 
67
  /** @brief Destroys the *global* scope Minuit object
 
68
   *
 
69
   *  This takes no arguments.
 
70
   */
 
71
  ~MapCppGlobalRawTracks();
 
72
 
 
73
  /** @brief Begin the startup procedure for TrackReconstructor
 
74
   *
 
75
   *
 
76
   *  @param config a JSON document with the configuration.
 
77
   */
 
78
  bool birth(std::string argJsonConfigDocument);
 
79
 
 
80
  /** @brief Shuts down the reconstructor
 
81
   *
 
82
   *  This takes no arguments
 
83
   */
 
84
  bool death();
 
85
 
 
86
  /** @brief Generate a list of reconstructed tracks.
 
87
   *
 
88
   *  This function takes a single spill and generates a list of tracks based
 
89
   *  on the desired method of recon.
 
90
   *
 
91
   * @param document a JSON document for a spill
 
92
   */
 
93
  std::string process(std::string document);
 
94
 
 
95
 private:
 
96
  MAUS::recon::global::DetectorMap detectors_;
 
97
  int beam_polarity_;
 
98
 
 
99
  static const std::string kClassname;
 
100
 
 
101
  // ************************
 
102
  //  Data Loading Functions
 
103
  // ************************
 
104
 
 
105
  void AssembleRawTracks(MAUS::ReconEvent * recon_event,
 
106
                         MAUS::GlobalEvent * global_event);
 
107
 
 
108
  MAUS::recon::global::DetectorMap LoadDetectorConfiguration();
 
109
 
 
110
  void LoadTOFTrack(
 
111
      MAUS::ReconEvent const * const recon_event,
 
112
      MAUS::DataStructure::Global::TrackPArray & tof_tracks);
 
113
 
 
114
  void PopulateTOFTrackPoint(
 
115
      const MAUS::recon::global::Detector & detector,
 
116
      const std::vector<TOFSpacePoint>::const_iterator & tof_space_point,
 
117
      const double slab_width,
 
118
      const size_t number_of_slabs,
 
119
      MAUS::DataStructure::Global::TrackPoint * track_point);
 
120
 
 
121
  double FindEnergy(const double mass,
 
122
                    const double delta_z,
 
123
                    const double delta_t) const;
 
124
 
 
125
  double TOFSlabEnergyLoss(const double beta, const double mass) const;
 
126
  double TOFMeanStoppingPower(const double beta, const double mass) const;
 
127
 
 
128
  void LoadSciFiTracks(
 
129
      MAUS::ReconEvent const * const recon_event,
 
130
      MAUS::DataStructure::Global::TrackPArray & sci_fi_tracks);
 
131
 
 
132
  void PopulateSciFiTrackPoint(
 
133
      const MAUS::recon::global::Detector & detector,
 
134
      const std::vector<SciFiTrackPoint *>::const_iterator & scifi_track_point,
 
135
      MAUS::DataStructure::Global::TrackPoint * track_point);
 
136
 
 
137
 
 
138
  // ***********************************
 
139
  //  Particle Identification Functions
 
140
  // ***********************************
 
141
 
 
142
  MAUS::DataStructure::Global::PID IdentifyParticle(const double beta);
 
143
 
 
144
  double Beta(MAUS::DataStructure::Global::PID pid, const double momentum);
 
145
};
 
146
 
 
147
}  // namespace MAUS
 
148
 
 
149
#endif  // _SRC_MAP_MapCppGlobalRawTracks_HH_