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"
49
class MapCppTrackerMCDigitization {
51
class MapCppTrackerMCDigitization : public MapBase<Data> {
51
53
/** Constructor - initialises pointers to NULL */
52
54
MapCppTrackerMCDigitization();
54
56
/** Constructor - deletes any allocated memory */
55
57
~MapCppTrackerMCDigitization();
57
60
/** Sets up the worker
59
62
* \param argJsonConfigDocument a JSON document with
60
63
* the configuration.
62
bool birth(std::string argJsonConfigDocument);
65
void _birth(const std::string& argJsonConfigDocument);
64
67
/** @brief Shutdowns the worker
66
69
* This takes no arguments and does nothing
70
/** @brief process JSON document
73
/** @brief process MAUS Data object
72
* Receive a document with MC hits and return
73
* a document with digits
75
std::string process(std::string document);
77
/** @brief reads in json data to a Spill object
79
void read_in_json(std::string json_data);
75
* Receive a object with MC hits and return
76
* a object with digits
78
void _process(MAUS::Data * data) const;
81
80
/** @brief builds digits
83
void construct_digits(MAUS::SciFiHitArray *hits, int spill_num, int event_num,
84
MAUS::SciFiDigitPArray &digits);
82
void construct_digits(MAUS::SciFiHitArray *hits,
85
MAUS::SciFiDigitPArray &digits) const;
86
void add_noise(MAUS::SciFiNoiseHitArray *noises, MAUS::SciFiDigitPArray &digits);
87
void add_noise(MAUS::SciFiNoiseHitArray *noises,
88
MAUS::SciFiDigitPArray &digits) const;
88
90
/** @brief computes scifi chan numb from GEANT fibre copy numb
90
int compute_chan_no(MAUS::SciFiHit *ahit);
92
int compute_chan_no(MAUS::SciFiHit *ahit) const;
92
94
/** @brief computes tdc from time.
94
int compute_tdc_counts(double time);
96
int compute_tdc_counts(double time) const;
96
98
/** @brief computes adc from npe.
98
int compute_adc_counts(double numb_pe);
100
int compute_adc_counts(double numb_pe) const;
100
102
/** @brief checks if hits belong to the same scifi channel.
102
bool check_param(MAUS::SciFiHit *hit1, MAUS::SciFiHit *hit2);
104
/** @brief saves digits to json.
106
void save_to_json(MAUS::Spill &spill);
104
bool check_param(MAUS::SciFiHit *hit1, MAUS::SciFiHit *hit2) const;
109
/// This should be the classname
110
std::string _classname;
111
/// This will contain the root value after parsing
112
Json::Value* _spill_json;
116
107
/// The ratio of deposited eV to NPE
117
108
double _eV_to_phe;
118
109
double _SciFiNPECut;