~christopher-hunt08/maus/maus_integrated_kalman

« back to all changes in this revision

Viewing changes to src/map/MapCppTOFSpacePoints/MapCppTOFSpacePoints.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:
31
31
#include "json/json.h"
32
32
 
33
33
#include "Utils/TOFCalibrationMap.hh"
 
34
#include "API/MapBase.hh"
34
35
 
35
36
namespace MAUS {
36
37
 
37
 
class MapCppTOFSpacePoints {
 
38
class MapCppTOFSpacePoints : public MapBase<Json::Value> {
38
39
 
39
40
 public:
 
41
  MapCppTOFSpacePoints();
40
42
 
 
43
 private:
41
44
 /** @brief Sets up the worker
42
45
 *
43
46
 *  @param argJsonConfigDocument a JSON document with
44
47
 *         the configuration.
45
48
 */
46
 
  bool birth(std::string argJsonConfigDocument);
 
49
  void _birth(const std::string& argJsonConfigDocument);
47
50
 
48
51
  /** @brief Shutdowns the worker
49
52
 *
50
53
 *  This takes no arguments and does nothing.
51
54
 */
52
 
  bool death();
 
55
  void _death();
53
56
 
54
57
  /** @brief process JSON document
55
58
 *
56
59
 *  @param document Receive a document with slab hits and return
57
60
 *  a document with space points.
58
61
 */
59
 
  std::string process(std::string document);
 
62
  void _process(Json::Value* document) const;
60
63
 
61
64
 private:
62
65
 
63
 
  std::string _classname;
64
 
 
65
66
  TOFCalibrationMap _map;
66
67
 
67
 
  std::vector<int> _xPlane0Hits;
68
 
  std::vector<int> _xPlane1Hits;
69
 
 
70
68
  double _makeSpacePointCut; // nanoseconds
71
69
  double _findTriggerPixelCut; // nanoseconds
72
70
  std::string _triggerStation;
73
71
 
74
72
  /// Vector to hold the names of all detectors to be processed.
75
73
  std::vector<std::string> _stationKeys;
76
 
  std::map<int, std::string> _triggerhit_pixels;
77
74
 
78
75
  Json::Value fillSpacePoint
79
 
                         (Json::Value &xDocSlabHit0, Json::Value &xDocSlabHit1);
80
 
  Json::Value processTOFStation
81
 
        (Json::Value &xSlabHits, std::string detector, unsigned int part_event);
82
 
  std::string findTriggerPixel(Json::Value xDocPartEvent);
 
76
                   (Json::Value &xDocSlabHit0, Json::Value &xDocSlabHit1) const;
 
77
  Json::Value processTOFStation(
 
78
                          Json::Value &xSlabHits,
 
79
                          std::string detector,
 
80
                          unsigned int part_event,
 
81
                          std::map<int, std::string>& _triggerhit_pixels) const;
 
82
 
 
83
  std::string findTriggerPixel(Json::Value xDocPartEvent,
 
84
                               std::vector<int> xPlane0Hits,
 
85
                               std::vector<int> xPlane1Hits) const;
83
86
  bool calibratePmtHit
84
 
                    (TOFPixelKey xPixelKey, Json::Value &xPmtHit, double &time);
 
87
              (TOFPixelKey xPixelKey, Json::Value &xPmtHit, double &time) const;
85
88
  bool calibrateSlabHit
86
 
                   (TOFPixelKey xPixelKey, Json::Value &xSlabHit, double &time);
 
89
             (TOFPixelKey xPixelKey, Json::Value &xSlabHit, double &time) const;
87
90
 
88
91
  /** @brief makes space points
89
92
   *
90
93
   *  @param xDocDetectorData Json document containing slab hits from 
91
94
   * one particle event in one individual detector.
92
95
   */
93
 
  Json::Value makeSpacePoints(Json::Value &xDocPartEvent);
 
96
  Json::Value makeSpacePoints(
 
97
                          Json::Value &xDocPartEvent,
 
98
                          std::vector<int> xPlane0Hits,
 
99
                          std::vector<int> xPlane1Hits,
 
100
                          std::map<int, std::string>& triggerhit_pixels) const;
94
101
  bool _map_init;
95
102
};
96
103
}