~m-a-uchida/maus/RKdEdxDevel

« back to all changes in this revision

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

  • Committer: Durga Rajaram
  • Date: 2014-01-14 07:07:02 UTC
  • mfrom: (659.1.80 relcand)
  • Revision ID: durga@fnal.gov-20140114070702-2l1fuj1w6rraw7xe
Tags: MAUS-v0.7.6
MAUS-v0.7.6

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 MapCppEMRPlaneHits
 
20
 * Reconstruct TOF data and creat Slab hits
 
21
 * by running over the TOF digits.
 
22
 *
 
23
 */
 
24
 
 
25
#ifndef _MAP_MAPCPPEMRPLANEHITS_H_
 
26
#define _MAP_MAPCPPEMRPLANEHITS_H_
 
27
 
 
28
// C headers
 
29
#include <assert.h>
 
30
#include <json/json.h>
 
31
 
 
32
// C++ headers
 
33
#include <string>
 
34
#include <vector>
 
35
#include <map>
 
36
 
 
37
#include "Utils/EMRChannelMap.hh"
 
38
#include "DataStructure/Data.hh"
 
39
#include "DataStructure/Spill.hh"
 
40
#include "DataStructure/ReconEvent.hh"
 
41
#include "DataStructure/DAQData.hh"
 
42
#include "DataStructure/EMRDaq.hh"
 
43
#include "DataStructure/DBBSpillData.hh"
 
44
#include "DataStructure/EMRBar.hh"
 
45
#include "DataStructure/EMRBarHit.hh"
 
46
#include "DataStructure/EMRPlaneHit.hh"
 
47
#include "DataStructure/EMREvent.hh"
 
48
 
 
49
namespace MAUS {
 
50
 
 
51
typedef std::vector<MAUS::EMRBarHit>    EMRBarHitsVector;
 
52
typedef std::vector<EMRBarHitsVector>   EMRBarVector;
 
53
typedef std::vector<EMRBarVector>       EMRPlaneVector;
 
54
typedef std::vector<EMRPlaneVector>     EMREventVector_4;
 
55
 
 
56
struct EMRPlaneData {
 
57
  int _orientation;
 
58
  int _charge;
 
59
  int _time;
 
60
  int _spill;
 
61
  int _deltat;
 
62
};
 
63
 
 
64
 
 
65
#define NUM_DBB_PLANES      48
 
66
#define NUM_DBB_CHANNELS    61
 
67
 
 
68
typedef std::vector<EMRPlaneData>                EMRPlaneHitsVector;
 
69
typedef std::vector<EMRPlaneHitsVector>          EMREventVector_2;
 
70
 
 
71
class MapCppEMRPlaneHits {
 
72
 
 
73
 public:
 
74
 
 
75
 /** @brief Sets up the worker
 
76
 *
 
77
 *  @param argJsonConfigDocument a JSON document with
 
78
 *         the configuration.
 
79
 */
 
80
  bool birth(std::string argJsonConfigDocument);
 
81
 
 
82
  /** @brief Shutdowns the worker
 
83
 *
 
84
 *  This takes no arguments and does nothing.
 
85
 */
 
86
  bool death();
 
87
 
 
88
  /** @brief process JSON document
 
89
 *
 
90
 *  @param document ?????.
 
91
 */
 
92
  std::string process(std::string document);
 
93
 
 
94
  /** @brief process the data object
 
95
 *
 
96
 *  @param
 
97
 */
 
98
  void process(MAUS::Data *data);
 
99
 
 
100
 private:
 
101
 
 
102
  void processDBB(MAUS::EMRDaq EMRdaq, int nPartTrigger);
 
103
  void processFADC(MAUS::EMRDaq EMRdaq, int nPartTrigger);
 
104
  void fill(MAUS::Spill *spill, int nPartTrigger);
 
105
 
 
106
  void reset_data_tmp(int nPartEvts);
 
107
 
 
108
  std::string _classname;
 
109
 
 
110
  EMRChannelMap _emrMap;
 
111
 
 
112
  int _trigger_window_lower;
 
113
  int _trigger_window_upper;
 
114
 
 
115
  EMREventVector_2     _emr_events_tmp2;
 
116
  EMREventVector_4     _emr_events_tmp4;
 
117
};
 
118
}
 
119
 
 
120
#endif