~chris-rogers/maus/emr_mc_digitization

« back to all changes in this revision

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

reverse merge from trunk

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:8080/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
 
 
19
/** @class MapCppTOFSlabHits
 
20
 * Reconstruct TOF data and creat Slab hits
 
21
 * by running over the TOF digits.
 
22
 *
 
23
 */
 
24
 
 
25
#ifndef _MAP_MAPCPPTOFSLABHITS_H_
 
26
#define _MAP_MAPCPPTOFSLABHITS_H_
 
27
 
 
28
#include <string>
 
29
#include <vector>
 
30
#include <map>
 
31
#include "json/json.h"
 
32
#include "src/common_cpp/Utils/TOFChannelMap.hh"
 
33
 
 
34
 
 
35
class MapCppTOFSlabHits {
 
36
 
 
37
 public:
 
38
 
 
39
 /** @brief Sets up the worker
 
40
 *
 
41
 *  @param argJsonConfigDocument a JSON document with
 
42
 *         the configuration.
 
43
 */
 
44
  bool birth(std::string argJsonConfigDocument);
 
45
 
 
46
  /** @brief Shutdowns the worker
 
47
 *
 
48
 *  This takes no arguments and does nothing.
 
49
 */
 
50
  bool death();
 
51
 
 
52
  /** @brief process JSON document
 
53
 *
 
54
 *  @param document Receive a document with digits and return
 
55
 *  a document with slab hits.
 
56
 */
 
57
  std::string process(std::string document);
 
58
 
 
59
 private:
 
60
  std::string _classname;
 
61
 
 
62
  /// Vector to hold the names of all detectors to be processed.
 
63
  std::vector<std::string> _stationKeys;
 
64
 
 
65
  Json::Value fillSlabHit(Json::Value xDocDigit0, Json::Value xDocDigit1);
 
66
 
 
67
  /** @brief makes slab hits
 
68
   *
 
69
   *  @param xDocDetectorData Json document containing digits from 
 
70
   * one particle event in one individual detector.
 
71
   */
 
72
  Json::Value makeSlabHits(Json::Value xDocPartEvent);
 
73
 
 
74
  double _tdcV1290_conversion_factor;
 
75
};
 
76
#endif