31
31
#include "json/json.h"
33
33
#include "Utils/TOFCalibrationMap.hh"
34
#include "API/MapBase.hh"
37
class MapCppTOFSpacePoints {
38
class MapCppTOFSpacePoints : public MapBase<Json::Value> {
41
MapCppTOFSpacePoints();
41
44
/** @brief Sets up the worker
43
46
* @param argJsonConfigDocument a JSON document with
44
47
* the configuration.
46
bool birth(std::string argJsonConfigDocument);
49
void _birth(const std::string& argJsonConfigDocument);
48
51
/** @brief Shutdowns the worker
50
53
* This takes no arguments and does nothing.
54
57
/** @brief process JSON document
56
59
* @param document Receive a document with slab hits and return
57
60
* a document with space points.
59
std::string process(std::string document);
62
void _process(Json::Value* document) const;
63
std::string _classname;
65
66
TOFCalibrationMap _map;
67
std::vector<int> _xPlane0Hits;
68
std::vector<int> _xPlane1Hits;
70
68
double _makeSpacePointCut; // nanoseconds
71
69
double _findTriggerPixelCut; // nanoseconds
72
70
std::string _triggerStation;
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;
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,
80
unsigned int part_event,
81
std::map<int, std::string>& _triggerhit_pixels) const;
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;
88
91
/** @brief makes space points
90
93
* @param xDocDetectorData Json document containing slab hits from
91
94
* one particle event in one individual detector.
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;