Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Correlator.hpp
Go to the documentation of this file.
1 
7 #ifndef __CORRELATOR_PROCESSOR_HPP_
8 #define __CORRELATOR_PROCESSOR_HPP_
9 
10 #include <utility>
11 #include <vector>
12 
13 #include <cmath>
14 
15 #include "Plots.hpp"
16 #include "DammPlotIds.hpp"
17 #include "Globals.hpp"
18 
19 class LogicProcessor;
20 class RawEvent;
21 
23 struct EventInfo
24 {
26  enum EEventTypes {IMPLANT_EVENT, ALPHA_EVENT, BETA_EVENT, FISSION_EVENT,
27  PROTON_EVENT, DECAY_EVENT, PROJECTILE_EVENT, GAMMA_EVENT,
28  UNKNOWN_EVENT};
29 
31  double time;
32  double dtime;
33  double energy;
34  double energyBox;
35  double offTime;
36  double foilTime;
37  double tof;
38  double position;
39  short boxMult;
40  short boxMax;
41  short impMult;
42  short mcpMult;
43  short generation;
44  bool flagged;
45  bool hasTof;
46  bool hasVeto;
47  bool beamOn;
48  bool pileUp;
49 
50  unsigned long clockCount;
52 
54  EventInfo();
59  EventInfo(double t, double e, LogicProcessor *lp);
60 };
61 
63 class CorrelationList : public std::vector<EventInfo> {
64 private:
65  bool flagged;
66 public:
70  double GetDecayTime(void) const;
72  double GetImplantTime(void) const;
74  void Flag(void);
76  bool IsFlagged(void) const;
78  void clear(void);
80  void PrintDecayList(void) const;
81 };
82 
95 class Correlator {
96 public:
98  enum EConditions {INVALID_LOCATION = 4,
99  VALID_IMPLANT = 12,
100  VALID_DECAY = 16,
101  BACK_TO_BACK_IMPLANT = 32,
102  DECAY_TOO_LATE = 48,
103  IMPLANT_TOO_SOON = 52,
104  UNKNOWN_CONDITION = 100};
106  Correlator();
108  virtual ~Correlator();
109 
111  void DeclarePlots(void);
114  void Init(RawEvent &rawev) {};
119  void Correlate(EventInfo &event, unsigned int fch, unsigned int bch);
126  void CorrelateAll(EventInfo &event);
130  void CorrelateAllX(EventInfo &event, unsigned int bch);
134  void CorrelateAllY(EventInfo &event, unsigned int fch);
138  void PrintDecayList(unsigned int fch, unsigned int bch) const;
139 
141  double GetDecayTime(void) const;
145  double GetDecayTime(int fch, int bch) const;
147  double GetImplantTime(void) const;
151  double GetImplantTime(int fch, int bch) const;
152 
156  void Flag(int fch, int bch);
157 
162  bool IsFlagged(int fch, int bch);
163 
165  EConditions GetCondition(void) const {
166  return condition;
167  }
168 
169 private:
171 
178  virtual void plot(int dammId, double val1, double val2 = -1,
179  double val3 = -1, const char* name="h") {
180  histo.Plot(dammId, val1, val2, val3, name);
181  }
182 
187  virtual void DeclareHistogram1D(int dammId, int xSize, const char* title) {
188  histo.DeclareHistogram1D(dammId, xSize, title);
189  }
190 
196  virtual void DeclareHistogram2D(int dammId, int xSize, int ySize,
197  const char* title) {
198  histo.DeclareHistogram2D(dammId, xSize, ySize, title);
199  }
200 
201  static const size_t arraySize = 40;
203  static const double minImpTime;
206  static const double corrTime;
209  static const double fastTime;
214 
217 };
218 #endif // __CORRELATOR_PROCESSOR_HPP_
bool DeclareHistogram2D(int dammId, int xSize, int ySize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, int yHistLength, int yLow, int yHigh, const std::string &mne="")
Declares a 2D histogram calls the C++ wrapper for DAMM.
EConditions condition
condition for last processed event
Definition: Correlator.hpp:215
void PrintDecayList(unsigned int fch, unsigned int bch) const
double GetDecayTime(void) const
Plots histo
Instance of the Plots class.
Definition: Correlator.hpp:170
double GetDecayTime(void) const
double foilTime
time difference to foil event
Definition: Correlator.hpp:36
void CorrelateAll(EventInfo &event)
Correlates all positions.
bool beamOn
beam is on target
Definition: Correlator.hpp:47
short boxMax
location of maximum energy in box
Definition: Correlator.hpp:40
bool IsFlagged(void) const
double time
timestamp of event
Definition: Correlator.hpp:31
virtual ~Correlator()
bool pileUp
trace is piled-up
Definition: Correlator.hpp:48
bool hasVeto
veto detector has been hit
Definition: Correlator.hpp:46
bool flagged
flagged of interest
Definition: Correlator.hpp:44
static const double corrTime
Definition: Correlator.hpp:206
short impMult
number of implant hits
Definition: Correlator.hpp:41
Lists Offsets and Ranges for various Processors.
bool hasTof
has time of flight data
Definition: Correlator.hpp:45
static const double minImpTime
Definition: Correlator.hpp:203
double energyBox
energy depositied into the box
Definition: Correlator.hpp:34
The list of correlations.
Definition: Correlator.hpp:63
double offTime
length of time beam has been off
Definition: Correlator.hpp:35
A container to request a block of plots and plot respective spectra through the plots register...
bool Plot(int dammId, double val1, double val2=-1, double val3=-1, const char *name="h")
Plots into histogram defined by dammId.
CorrelationList decaylist[arraySize][arraySize]
list of event data for a particular pixel since implant
Definition: Correlator.hpp:216
void Init(RawEvent &rawev)
Definition: Correlator.hpp:114
virtual void plot(int dammId, double val1, double val2=-1, double val3=-1, const char *name="h")
plots data into a histogram with provided DAMM ID
Definition: Correlator.hpp:178
correlate decays with previous implants
Definition: Correlator.hpp:95
EEventTypes
types of events passed to the correlator
Definition: Correlator.hpp:26
void Flag(void)
double tof
time of flight for an implant
Definition: Correlator.hpp:37
double GetImplantTime(void) const
bool flagged
flag telling if something has been flagged
Definition: Correlator.hpp:65
constant parameters used in pixie16 analysis
double dtime
time since implant [pixie units]
Definition: Correlator.hpp:32
EventInfo * lastImplant
last implant processed by correlator
Definition: Correlator.hpp:212
Structure to contain the event info.
Definition: Correlator.hpp:23
void CorrelateAllX(EventInfo &event, unsigned int bch)
static const double fastTime
Definition: Correlator.hpp:209
double GetImplantTime(void) const
short generation
generation number (0 = implant)
Definition: Correlator.hpp:43
unsigned long clockCount
the counter on the clock
Definition: Correlator.hpp:50
unsigned char logicBits[dammIds::logic::MAX_LOGIC+1]
array of logic bits
Definition: Correlator.hpp:51
static const size_t arraySize
Definition: Correlator.hpp:201
void CorrelateAllY(EventInfo &event, unsigned int fch)
double energy
energy of event
Definition: Correlator.hpp:33
void DeclarePlots(void)
virtual void DeclareHistogram2D(int dammId, int xSize, int ySize, const char *title)
Declares a 2D histogram calls the C++ wrapper for DAMM.
Definition: Correlator.hpp:196
EEventTypes type
event type
Definition: Correlator.hpp:30
void clear(void)
overide the vector clear function so that the flag is also removed
const int MAX_LOGIC
maximum number of logic signals
Definition: DammPlotIds.hpp:95
Class to handle logic signals.
Definition: LogicProcessor.hpp:13
EConditions
correlator condition based on the given events
Definition: Correlator.hpp:98
short mcpMult
number of mcp hits
Definition: Correlator.hpp:42
short boxMult
numebr of box hits
Definition: Correlator.hpp:39
double position
calculated strip position
Definition: Correlator.hpp:38
EventInfo * lastDecay
last decay procssed by correlator
Definition: Correlator.hpp:213
The all important raw event.
Definition: RawEvent.hpp:46
virtual void DeclareHistogram1D(int dammId, int xSize, const char *title)
Declares a 1D histogram calls the C++ wrapper for DAMM.
Definition: Correlator.hpp:187
bool DeclareHistogram1D(int dammId, int xSize, const char *title, int halfWordsPerChan, int xHistLength, int xLow, int xHigh, const std::string &mne="")
Declares a 1D histogram calls the C++ wrapper for DAMM.
void PrintDecayList(void) const
void Flag(int fch, int bch)
Holds pointers to all Histograms.
Definition: Plots.hpp:27
void Correlate(EventInfo &event, unsigned int fch, unsigned int bch)
EConditions GetCondition(void) const
Definition: Correlator.hpp:165
bool IsFlagged(int fch, int bch)