RawDigitMixer.h
Go to the documentation of this file.
1 /**
2  * \file RawDigitMixer.h
3  *
4  * \ingroup DataOverlay
5  *
6  * \brief Mixer function for putting together two raw digit collections
7  *
8  * @author wketchum
9  */
10 
11 /** \addtogroup DataOverlay
12 
13  @{*/
14 #ifndef OVERLAY_DATAOVERLAY_RAWDIGITMIXER_H
15 #define OVERLAY_DATAOVERLAY_RAWDIGITMIXER_H
16 
17 #include <vector>
18 #include <string>
19 #include <unordered_map>
20 
21 #include "lardataobj/RawData/raw.h"
24 #include "RawDigitAdder_35t.h"
25 
26 #if defined __clang__
27  #pragma clang diagnostic push
28  #pragma clang diagnostic ignored "-Wunused-private-field"
29 #endif
30 
31 
32 /**
33  \class RawDigitMixer
34  Add two raw digit collections together.
35 
36 */
37 
38 namespace mix {
39  class RawDigitMixer;
40 }
41 
43 
44 public:
45 
46  /// Default constructor
47  RawDigitMixer(bool p=false):
48  _printWarnings(p){};
49 
50  void DeclareData(std::vector<raw::RawDigit> const& dataVector);
51  void Mix(std::vector<raw::RawDigit> const& mcVector,
52  std::unordered_map<raw::ChannelID_t,float> const& map);
53 
54  void FillRawDigitOutput(std::vector<raw::RawDigit> & output);
55 
56  /// Default destructor
57  virtual ~RawDigitMixer(){};
58 
60  void SetDataMixTicks(size_t start, size_t end) { _datastart = start; _dataend = end; }
61  void SetMCMixTicks(size_t start, size_t end) { _mcstart = start; _mcend = end; }
62 
63  private:
64 
67  size_t _datastart;
68  size_t _dataend;
69  size_t _mcstart;
70  size_t _mcend;
71 
72  //this is just to make storing this info easier, for RawDigit construction later
73  struct RD_Info{
74  std::vector<short> waveform;
76  float ped;
77  float sigma;
78  };
79  std::vector< RD_Info > fOutputWaveforms;
80 
81  std::unordered_map<raw::ChannelID_t,size_t> fChannelIndexMap;
82 
84 
85 };
86 #if defined __clang__
87  #pragma clang diagnostic pop
88 #endif
89 
90 #endif
91 /** @} */ // end of doxygen group
92 
virtual ~RawDigitMixer()
Default destructor.
Definition: RawDigitMixer.h:57
std::vector< short > waveform
Definition: RawDigitMixer.h:74
Defintion for a class to add two vectors together, and give an "added" waveform.
void FillRawDigitOutput(std::vector< raw::RawDigit > &output)
Definition of basic raw digits.
RawDigitAdder_35t fRDAdderAlg
Definition: RawDigitMixer.h:83
void SetMCMixTicks(size_t start, size_t end)
Definition: RawDigitMixer.h:61
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
raw::ChannelID_t channel
Definition: RawDigitMixer.h:75
Collect all the RawData header files together.
void SetStuckBitRetentionMethod(bool b)
Definition: RawDigitMixer.h:59
p
Definition: test.py:223
void Mix(std::vector< raw::RawDigit > const &mcVector, std::unordered_map< raw::ChannelID_t, float > const &map)
std::unordered_map< raw::ChannelID_t, size_t > fChannelIndexMap
Definition: RawDigitMixer.h:81
static bool * b
Definition: config.cpp:1043
RawDigitMixer(bool p=false)
Default constructor.
Definition: RawDigitMixer.h:47
void DeclareData(std::vector< raw::RawDigit > const &dataVector)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:27
void SetDataMixTicks(size_t start, size_t end)
Definition: RawDigitMixer.h:60
std::vector< RD_Info > fOutputWaveforms
Definition: RawDigitMixer.h:79