Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
GeProcessor.hpp
Go to the documentation of this file.
1 
4 #ifndef __GEPROCESSOR_HPP_
5 #define __GEPROCESSOR_HPP_
6 
7 #include <map>
8 #include <vector>
9 #include <utility>
10 #include <cmath>
11 
12 #include "EventProcessor.hpp"
13 #include "RawEvent.hpp"
14 
15 namespace dammIds {
17  namespace ge {
25  const unsigned int MAX_CLOVERS = 4;
26  const unsigned int MAX_TIMEX = 5;
27 
28  const int D_ENERGY = 0;
29  const int D_ENERGY_CLOVERX = 2;
30  const int D_ENERGY_MOVE = 6;
31  const int D_MULT = 9;
32  const int D_ADD_ENERGY = 50;
33  const int D_ADD_ENERGY_CLOVERX = 55;
34  const int D_ADD_ENERGY_TOTAL = 59;
35 
36  const int DD_ENERGY = 100;
37  const int DD_ENERGY_PROMPT = 101;
38  const int DD_ENERGY_CGATE1 = 102;
39  const int DD_ENERGY_CGATE2 = 103;
40 
41  const int DD_TDIFF__GATEX = 105;
42  const int DD_ENERGY__GATEX = 106;
43  const int DD_ANGLE__GATEX = 107;
44 
45  const int DD_ENERGY__TIMEX = 120;
46 
47  const int DD_ADD_ENERGY = 150;
48 
51 
52  const int DD_ADD_ENERGY__TIMEX = 170;
53 
55  namespace betaGated {
56  const int D_ENERGY = 10;
57  const int D_ENERGY_PROMPT = 11;
58  const int D_ENERGY_CLOVERX = 12;
59  const int D_ENERGY_MOVE = 16;
60  const int D_ENERGY_BETA0 = 17;
61  const int D_ENERGY_BETA1 = 18;
62  const int DD_ENERGY__BETAGAMMALOC = 19;
63 
64  const int D_ADD_ENERGY = 60;
65  const int D_ADD_ENERGY_PROMPT = 61;
66  const int D_ADD_ENERGY_CLOVERX = 65;
67  const int D_ADD_ENERGY_TOTAL = 69;
68 
69  const int DD_ENERGY = 110;
70  const int DD_ENERGY_PROMPT = 111;
71  const int DD_ENERGY_CGATE1 = 112;
72  const int DD_ENERGY_CGATE2 = 113;
73  const int DD_ENERGY_BDELAYED = 114;
74 
75  const int DD_TDIFF__GATEX = 115;
76  const int DD_ENERGY__GATEX = 116;
77  const int DD_ANGLE__GATEX = 117;
78 
79  const int DD_TDIFF__GAMMA_ENERGY = 118;
80  const int DD_TDIFF__BETA_ENERGY = 119;
81 
82  const int DD_ENERGY__TIMEX = 130;
83  const int DD_ENERGY__TIMEX_GROW = 135;
84  const int DD_ENERGY__TIMEX_DECAY = 140;
85 
86  const int DD_ADD_ENERGY = 160;
87  const int DD_ADD_ENERGY_PROMPT = 161;
88  const int DD_ADD_ENERGY__TIMEX = 180;
89  }
90 
92  namespace multi {
93  const int D_ADD_ENERGY = 52;
94  const int D_ADD_ENERGY_TOTAL = 54;
95  const int DD_ADD_ENERGY = 152;
96  namespace betaGated {
98  const int D_ADD_ENERGY = 62;
99  const int D_ADD_ENERGY_PROMPT = 63;
100  const int D_ADD_ENERGY_TOTAL = 64;
101  const int DD_ADD_ENERGY = 162;
102  const int DD_ADD_ENERGY_PROMPT = 163;
103  }
104  }
105  } // end namespace ge
106 }
107 
108 #ifdef GGATES
109 
111 class LineGate {
112  public:
114  LineGate() {min = max = -1;};
115 
117  LineGate(double emin, double emax) {
118  min = emin;
119  max = emax;
120  }
121 
124  bool Check() {
125  if (min > 0 && max > min)
126  return true;
127  else
128  return false;
129  }
130 
133  bool IsWithin(double x) {
134  if (x >= min && x <= max)
135  return true;
136  else
137  return false;
138  }
139 
142  bool operator< (const LineGate& other) const {
143  return (min < other.min);
144  }
145 
146  double min;
147  double max;
148 };
149 #endif
150 
154  public:
157  energy = time = multiplicity = 0;
158  }
159 
164  AddBackEvent(double ienergy, double itime, unsigned imultiplicity) {
165  energy = ienergy;
166  time = itime;
167  multiplicity = imultiplicity;
168  }
169 
170  double energy;
171  double time;
172  unsigned multiplicity;
173 };
174 
176 class GeProcessor : public EventProcessor {
177 public:
189  GeProcessor(double gammaThreshold, double lowRatio,
190  double highRatio, double subEventWindow,
191  double gammaBetaLimit, double gammaGammaLimit,
192  double cycle_gate1_min, double cycle_gate1_max,
193  double cycle_gate2_min, double cycle_gate2_max);
197  virtual bool PreProcess(RawEvent &event);
201  virtual bool Process(RawEvent &event);
203  virtual void DeclarePlots(void);
204 protected:
205  static const unsigned int chansPerClover = 4;
207  std::map<int, int> leafToClover;
208  std::vector<float> timeResolution;
209  unsigned int numClovers;
214  EventData BestBetaForGamma(double gTime);
215 
221  bool GoodGammaBeta(double gTime);
222 
224  std::vector<ChanEvent*> geEvents_;
225 
234  void DeclareHistogramGranY(int dammId, int xsize, int ysize,
235  const char *title, int halfWordsPerChan,
236  const std::vector<float> &granularity, const char *units );
242  void granploty(int dammId, double x, double y,
243  const std::vector<float> &granularity);
248  void symplot(int dammID, double bin1, double bin2);
249 
253  std::vector< std::vector<AddBackEvent> > addbackEvents_;
256  std::vector<AddBackEvent> tas_;
257 #ifdef GGATES
258  std::vector< std::vector<LineGate> > gGates;
259 #endif
260 
263 
264  double lowRatio_;
265  double highRatio_;
266 
269 
272 
275 
283 };
284 #endif // __GEPROCESSOR_HPP_
const int D_MULT
Multiplicity.
Definition: GeProcessor.hpp:31
std::vector< AddBackEvent > tas_
Definition: GeProcessor.hpp:256
double gammaGammaLimit_
Definition: GeProcessor.hpp:274
double cycle_gate1_min_
low value for first cycle gate
Definition: GeProcessor.hpp:279
const int DD_TDIFF__BETA_ENERGY
Beta Gated Tdiff vs. Beta Energy.
Definition: GeProcessor.hpp:80
const int DD_ENERGY__TIMEX_GROW
Beta Gated Energy vs. Grow Cycle.
Definition: GeProcessor.hpp:83
const unsigned int MAX_CLOVERS
for *_DETX spectra
Definition: GeProcessor.hpp:25
AddBackEvent(double ienergy, double itime, unsigned imultiplicity)
Definition: GeProcessor.hpp:164
const int D_ADD_ENERGY_TOTAL
Addback energy total.
Definition: GeProcessor.hpp:34
const int DD_ADD_ENERGY_PROMPT
beta/multi gated addback energy
Definition: GeProcessor.hpp:102
double cycle_gate1_max_
high value for first cycle gate
Definition: GeProcessor.hpp:280
double energy
Energy of the addback event.
Definition: GeProcessor.hpp:170
const int D_ENERGY_MOVE
Energy during move.
Definition: GeProcessor.hpp:30
Generic event processor.
const int DD_ENERGY__BETAGAMMALOC
Energy vs Beta-Gamma Loc.
Definition: GeProcessor.hpp:62
Processor to handle Ge (read as clover) events.
Definition: GeProcessor.hpp:176
double lowRatio_
ratio between low and high gain to be accepted w/o saturation flag
Definition: GeProcessor.hpp:264
std::vector< float > timeResolution
Definition: GeProcessor.hpp:208
virtual bool PreProcess(RawEvent &event)
Simple structure-like class to store info on addback reconstructed event.
Definition: GeProcessor.hpp:153
static const unsigned int chansPerClover
Definition: GeProcessor.hpp:205
virtual bool Process(RawEvent &event)
std::vector< ChanEvent * > geEvents_
Definition: GeProcessor.hpp:224
const int DD_ENERGY__TIMEX_DECAY
Beta Gated Energy vs. Decay Cycle.
Definition: GeProcessor.hpp:84
const int DD_ENERGY
Gamma-Gamma Energy.
Definition: GeProcessor.hpp:36
void symplot(int dammID, double bin1, double bin2)
std::map< int, int > leafToClover
Definition: GeProcessor.hpp:207
const int DD_TDIFF__GAMMA_ENERGY
Beta Gated TDiff vs. Gamma Energy.
Definition: GeProcessor.hpp:79
const int D_ENERGY
Energy.
Definition: GeProcessor.hpp:28
virtual void DeclarePlots(void)
const int D_ADD_ENERGY_PROMPT
Beta Gated Add Back Prompt Energy.
Definition: GeProcessor.hpp:65
double time
time of the addback event
Definition: GeProcessor.hpp:171
const int DD_ENERGY_PROMPT
Gamma-Gamma Spectra - Prompt.
Definition: GeProcessor.hpp:37
const int DD_ADD_ENERGY_PROMPT
Beta Gated Gamma-Gamma Prompt addback.
Definition: GeProcessor.hpp:87
unsigned multiplicity
multiplicity of the event
Definition: GeProcessor.hpp:172
const int DD_ENERGY_BDELAYED
Beta Gated Gamma-Gamma Beta Delayed.
Definition: GeProcessor.hpp:73
double cycle_gate2_min_
low value for second cycle gate
Definition: GeProcessor.hpp:281
const int D_ADD_ENERGY_PROMPT
beta/multi gated prompt addback energy
Definition: GeProcessor.hpp:99
const int DD_ENERGY_CGATE1
Gamma-Gamma - Cycle Gate 1.
Definition: GeProcessor.hpp:38
double gammaBetaLimit_
Definition: GeProcessor.hpp:271
GeProcessor(double gammaThreshold, double lowRatio, double highRatio, double subEventWindow, double gammaBetaLimit, double gammaGammaLimit, double cycle_gate1_min, double cycle_gate1_max, double cycle_gate2_min, double cycle_gate2_max)
Namespace containing all the histogram id definitions.
Definition: BetaScintProcessor.hpp:12
const int D_ADD_ENERGY_CLOVERX
Add back energy per clover.
Definition: GeProcessor.hpp:33
const int DD_ADD_ENERGY__TIMEX
Addback Energy vs. Time.
Definition: GeProcessor.hpp:52
const int DD_ADD_ENERGY
Addback Energy.
Definition: GeProcessor.hpp:47
Simple structure holding basic parameters needed for correlation of events in the same place...
Definition: EventData.hpp:12
const unsigned int MAX_TIMEX
for *_TIMEX spectra
Definition: GeProcessor.hpp:26
const int DD_TDIFF__GAMMA_GAMMA_ENERGY
Tdiff vs Gamma-Gamma Energy.
Definition: GeProcessor.hpp:49
const int DD_TDIFF__GATEX
Tdiff Gamma - Beta - Gated.
Definition: GeProcessor.hpp:41
const int DD_ENERGY__GATEX
Energy - Gated.
Definition: GeProcessor.hpp:42
const int D_ENERGY_BETA0
Energy Beta 0.
Definition: GeProcessor.hpp:60
const int DD_ENERGY__TIMEX
Energy vs. Time.
Definition: GeProcessor.hpp:45
AddBackEvent()
Definition: GeProcessor.hpp:156
double highRatio_
ratio between low and high gain to be accepted w/o saturation flag
Definition: GeProcessor.hpp:265
const int D_ENERGY_PROMPT
Beta Gated Prompt Energy.
Definition: GeProcessor.hpp:57
const int DD_TDIFF__GAMMA_GAMMA_ENERGY_SUM
Tdiff vs. Gamma-Gamma Energy sum.
Definition: GeProcessor.hpp:50
const int DD_ENERGY_CGATE2
Gamma-Gamma - Cycle Gate 2.
Definition: GeProcessor.hpp:39
double cycle_gate2_max_
high value for second cycle gate
Definition: GeProcessor.hpp:282
Class to handle event processing.
Definition: EventProcessor.hpp:25
std::vector< std::vector< AddBackEvent > > addbackEvents_
Definition: GeProcessor.hpp:253
const int DD_ANGLE__GATEX
Gamma Angle - Gated.
Definition: GeProcessor.hpp:43
void DeclareHistogramGranY(int dammId, int xsize, int ysize, const char *title, int halfWordsPerChan, const std::vector< float > &granularity, const char *units)
const int D_ENERGY_BETA1
Energy Beta 1.
Definition: GeProcessor.hpp:61
unsigned int numClovers
Definition: GeProcessor.hpp:209
double subEventWindow_
Definition: GeProcessor.hpp:268
The all important raw event.
Definition: RawEvent.hpp:46
bool GoodGammaBeta(double gTime)
const int D_ADD_ENERGY
Addback energy.
Definition: GeProcessor.hpp:32
const int D_ENERGY_CLOVERX
Energy Full Clover.
Definition: GeProcessor.hpp:29
void granploty(int dammId, double x, double y, const std::vector< float > &granularity)
Header file for the rawevent.
EventData BestBetaForGamma(double gTime)
double gammaThreshold_
Definition: GeProcessor.hpp:262