~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

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

  • Committer: Durga Rajaram
  • Date: 2014-07-16 15:13:05 UTC
  • mfrom: (659.1.92 cand)
  • Revision ID: durga@fnal.gov-20140716151305-q27rv1y9p03v9lks
Tags: MAUS-v0.9, MAUS-v0.9.0
MAUS-v0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
 
36
36
#include "Config/MiceModule.hh"
37
37
#include "Interface/Squeak.hh"
 
38
#include "src/common_cpp/DataStructure/Data.hh"
38
39
#include "src/common_cpp/DataStructure/Hit.hh"
39
40
#include "src/common_cpp/DataStructure/MCEvent.hh"
40
41
#include "src/common_cpp/DataStructure/Spill.hh"
43
44
#include "src/common_cpp/Utils/Globals.hh"
44
45
#include "src/common_cpp/Globals/GlobalsManager.hh"
45
46
#include "src/common_cpp/JsonCppProcessors/SpillProcessor.hh"
 
47
#include "src/common_cpp/API/MapBase.hh"
46
48
 
47
49
namespace MAUS {
48
50
 
49
 
class MapCppTrackerMCDigitization {
 
51
class MapCppTrackerMCDigitization : public MapBase<Data> {
50
52
 public:
51
53
  /** Constructor - initialises pointers to NULL */
52
54
  MapCppTrackerMCDigitization();
54
56
  /** Constructor - deletes any allocated memory */
55
57
  ~MapCppTrackerMCDigitization();
56
58
 
 
59
 private:
57
60
  /** Sets up the worker
58
61
   *
59
62
   *  \param argJsonConfigDocument a JSON document with
60
63
   *         the configuration.
61
64
   */
62
 
  bool birth(std::string argJsonConfigDocument);
 
65
  void _birth(const std::string& argJsonConfigDocument);
63
66
 
64
67
  /** @brief Shutdowns the worker
65
68
   *
66
69
   *  This takes no arguments and does nothing
67
70
   */
68
 
  bool death();
 
71
  void _death();
69
72
 
70
 
  /** @brief process JSON document
 
73
  /** @brief process MAUS Data object
71
74
   *
72
 
   *  Receive a document with MC hits and return
73
 
   *  a document with digits
74
 
   */
75
 
  std::string process(std::string document);
76
 
 
77
 
  /** @brief reads in json data to a Spill object
78
 
   */
79
 
  void read_in_json(std::string json_data);
 
75
   *  Receive a object with MC hits and return
 
76
   *  a object with digits
 
77
   */
 
78
  void _process(MAUS::Data * data) const;
80
79
 
81
80
  /** @brief builds digits
82
81
   */
83
 
  void construct_digits(MAUS::SciFiHitArray *hits, int spill_num, int event_num,
84
 
                        MAUS::SciFiDigitPArray &digits);
 
82
  void construct_digits(MAUS::SciFiHitArray *hits,
 
83
                        int spill_num,
 
84
                        int event_num,
 
85
                        MAUS::SciFiDigitPArray &digits) const;
85
86
 
86
 
  void add_noise(MAUS::SciFiNoiseHitArray *noises, MAUS::SciFiDigitPArray &digits);
 
87
  void add_noise(MAUS::SciFiNoiseHitArray *noises,
 
88
                 MAUS::SciFiDigitPArray &digits) const;
87
89
 
88
90
  /** @brief computes scifi chan numb from GEANT fibre copy numb
89
91
   */
90
 
  int compute_chan_no(MAUS::SciFiHit *ahit);
 
92
  int compute_chan_no(MAUS::SciFiHit *ahit) const;
91
93
 
92
94
  /** @brief computes tdc from time.
93
95
   */
94
 
  int compute_tdc_counts(double time);
 
96
  int compute_tdc_counts(double time) const;
95
97
 
96
98
  /** @brief computes adc from npe.
97
99
   */
98
 
  int compute_adc_counts(double numb_pe);
 
100
  int compute_adc_counts(double numb_pe) const;
99
101
 
100
102
  /** @brief checks if hits belong to the same scifi channel.
101
103
   */
102
 
  bool check_param(MAUS::SciFiHit *hit1, MAUS::SciFiHit *hit2);
103
 
 
104
 
  /** @brief saves digits to json.
105
 
   */
106
 
  void save_to_json(MAUS::Spill &spill);
 
104
  bool check_param(MAUS::SciFiHit *hit1, MAUS::SciFiHit *hit2) const;
107
105
 
108
106
 private:
109
 
  /// This should be the classname
110
 
  std::string _classname;
111
 
  /// This will contain the root value after parsing
112
 
  Json::Value* _spill_json;
113
 
  Spill* _spill_cpp;
114
 
  ///  JsonCpp setup
115
 
  Json::Reader reader;
116
107
  /// The ratio of deposited eV to NPE
117
108
  double _eV_to_phe;
118
109
  double _SciFiNPECut;