Belle II Software  release-05-01-25
ECLDsp.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2018 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Poyuan Chen *
7  * Savino Longo *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 #ifndef ECLDSP_H
13 #define ECLDSP_H
14 
15 #include <framework/datastore/RelationsObject.h>
16 namespace Belle2 {
29  class ECLDsp : public RelationsObject {
30  public:
31 
33  enum TwoComponentFitType {
34  poorChi2 = -1,
35  photonHadron = 0,
38  };
39 
41  ECLDsp() : m_DspAVector(31, 0) {}
42 
44  ECLDsp(int CellId, int NADCPoints, int* ADCData)
45  {
46  m_CellId = CellId;
47  m_DspAVector.assign(ADCData, ADCData + NADCPoints);
48  }
49 
51  ECLDsp(int CellId, const std::vector<int>& ADCData) :
52  m_CellId(CellId), m_DspAVector(ADCData) {}
53 
56  void setCellId(int CellId) { m_CellId = CellId; }
57 
60  void setDspA(int DspArray[31])
61  {
62  m_DspAVector.assign(DspArray, DspArray + 31);
63  }
64 
67  void setDspA(const std::vector <int>& DspArrayVector)
68  {
69  m_DspAVector = DspArrayVector;
70  }
71 
74  void setTwoComponentTotalAmp(double input) { m_TwoComponentTotalAmp = input; }
75 
78  void setTwoComponentHadronAmp(double input) { m_TwoComponentHadronAmp = input; }
79 
82  void setTwoComponentDiodeAmp(double input) { m_TwoComponentDiodeAmp = input; }
83 
86  void setTwoComponentChi2(double input) { m_TwoComponentChi2 = input; }
87 
91  void setTwoComponentSavedChi2(TwoComponentFitType FitTypeIn, double input)
92  {
93  unsigned int index = FitTypeIn ;
94  m_TwoComponentSavedChi2[index] = input;
95  }
96 
99  void setTwoComponentTime(double input) { m_TwoComponentTime = input; }
100 
103  void setTwoComponentBaseline(double input) { m_TwoComponentBaseline = input; }
104 
107  void setbackgroundPhotonEnergy(double input) { m_backgroundPhotonEnergy = input; }
108 
111  void setbackgroundPhotonTime(double input) { m_backgroundPhotonTime = input; }
112 
116 
120  int getCellId() const { return m_CellId; }
121 
125  void getDspA(int DspArray[31]) const
126  {
127  for (int i = 0; i < 31; i++)
128  DspArray[i] = m_DspAVector[i];
129  }
130 
131 
135  double getTwoComponentTotalAmp() const { return m_TwoComponentTotalAmp;}
136 
140  double getTwoComponentHadronAmp() const { return m_TwoComponentHadronAmp; }
141 
145  double getTwoComponentDiodeAmp() const { return m_TwoComponentDiodeAmp; }
146 
150  double getTwoComponentChi2() const { return m_TwoComponentChi2; }
151 
156  double getTwoComponentSavedChi2(TwoComponentFitType FitTypeIn) const
157  {
158  unsigned int index = FitTypeIn ;
159  return m_TwoComponentSavedChi2[index];
160  }
161 
165  double getTwoComponentTime() const { return m_TwoComponentTime; }
166 
170  double getTwoComponentBaseline() const { return m_TwoComponentBaseline; }
171 
176 
180  double getbackgroundPhotonEnergy() const { return m_backgroundPhotonEnergy; }
181 
185  double getbackgroundPhotonTime() const { return m_backgroundPhotonTime; }
186 
190  std::vector <int> getDspA() const
191  {
192  return m_DspAVector;
193  }
194 
198  int getNADCPoints() const
199  {
200  return m_DspAVector.size();
201  }
202 
203  private:
204 
205  int m_CellId{0};
206  double m_TwoComponentTotalAmp{ -1};
208  double m_TwoComponentDiodeAmp{ -1};
209  double m_TwoComponentChi2{ -1};
210  double m_TwoComponentSavedChi2[3] = { -1, -1, -1};
211  double m_TwoComponentTime{1};
212  double m_TwoComponentBaseline{1};
213  double m_backgroundPhotonEnergy{ -1};
216  std::vector <int> m_DspAVector;
224 
225  };
227 } // end namespace Belle2
228 
229 #endif
Belle2::ECLDsp::m_CellId
int m_CellId
Cell ID.
Definition: ECLDsp.h:214
Belle2::ECLDsp::getTwoComponentChi2
double getTwoComponentChi2() const
get two comp chi2
Definition: ECLDsp.h:159
Belle2::ECLDsp::photonHadron
@ photonHadron
photon + hadron template fit
Definition: ECLDsp.h:44
Belle2::ECLDsp::m_TwoComponentTime
double m_TwoComponentTime
Two comp time.
Definition: ECLDsp.h:220
Belle2::ECLDsp::setTwoComponentTime
void setTwoComponentTime(double input)
Set two comp time.
Definition: ECLDsp.h:108
Belle2::ECLDsp::getTwoComponentBaseline
double getTwoComponentBaseline() const
get two comp baseline
Definition: ECLDsp.h:179
Belle2::ECLDsp::getbackgroundPhotonTime
double getbackgroundPhotonTime() const
get pile up photon time
Definition: ECLDsp.h:194
Belle2::ECLDsp::TwoComponentFitType
TwoComponentFitType
Offline two component fit type.
Definition: ECLDsp.h:42
Belle2::ECLDsp::m_DspAVector
std::vector< int > m_DspAVector
Dsp array vith variable length for calibration, tests, etc.
Definition: ECLDsp.h:225
Belle2::ECLDsp::setCellId
void setCellId(int CellId)
Set Cell ID.
Definition: ECLDsp.h:65
Belle2::ECLDsp::setTwoComponentTotalAmp
void setTwoComponentTotalAmp(double input)
Set two comp total amp.
Definition: ECLDsp.h:83
Belle2::ECLDsp
Class to store ECL ShaperDSP waveform ADC data.
Definition: ECLDsp.h:38
Belle2::ECLDsp::getbackgroundPhotonEnergy
double getbackgroundPhotonEnergy() const
get pile up photon energy
Definition: ECLDsp.h:189
Belle2::ECLDsp::ClassDef
ClassDef(ECLDsp, 6)
2 dspa array with variable length
Belle2::ECLDsp::getTwoComponentTime
double getTwoComponentTime() const
get two comp time
Definition: ECLDsp.h:174
Belle2::ECLDsp::getTwoComponentHadronAmp
double getTwoComponentHadronAmp() const
get two comp hadron amp
Definition: ECLDsp.h:149
Belle2::ECLDsp::ECLDsp
ECLDsp()
default constructor for ROOT
Definition: ECLDsp.h:50
Belle2::ECLDsp::m_TwoComponentBaseline
double m_TwoComponentBaseline
Two comp baseline.
Definition: ECLDsp.h:221
Belle2::ECLDsp::setTwoComponentHadronAmp
void setTwoComponentHadronAmp(double input)
Set two comp hadron amp.
Definition: ECLDsp.h:87
Belle2::ECLDsp::m_TwoComponentDiodeAmp
double m_TwoComponentDiodeAmp
Two comp diode amp.
Definition: ECLDsp.h:217
Belle2::ECLDsp::setDspA
void setDspA(int DspArray[31])
Set Dsp array.
Definition: ECLDsp.h:69
Belle2::ECLDsp::m_backgroundPhotonTime
double m_backgroundPhotonTime
Pile-up photon time.
Definition: ECLDsp.h:223
Belle2::ECLDsp::setTwoComponentBaseline
void setTwoComponentBaseline(double input)
Set two comp baseline.
Definition: ECLDsp.h:112
Belle2::ECLDsp::poorChi2
@ poorChi2
All offline fit attempts were greater than chi2 threshold.
Definition: ECLDsp.h:43
Belle2::ECLDsp::setTwoComponentChi2
void setTwoComponentChi2(double input)
Set two comp chi2.
Definition: ECLDsp.h:95
Belle2::ECLDsp::getDspA
std::vector< int > getDspA() const
Get Dsp Array.
Definition: ECLDsp.h:199
Belle2::ECLDsp::getTwoComponentDiodeAmp
double getTwoComponentDiodeAmp() const
get two comp diode amp
Definition: ECLDsp.h:154
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::ECLDsp::getTwoComponentFitType
TwoComponentFitType getTwoComponentFitType() const
get two comp fit type
Definition: ECLDsp.h:184
Belle2::ECLDsp::photonDiodeCrossing
@ photonDiodeCrossing
photon + diode template fit
Definition: ECLDsp.h:46
Belle2::ECLDsp::setbackgroundPhotonTime
void setbackgroundPhotonTime(double input)
Set pile-up photon time.
Definition: ECLDsp.h:120
Belle2::ECLDsp::setTwoComponentDiodeAmp
void setTwoComponentDiodeAmp(double input)
Set two comp diode amp.
Definition: ECLDsp.h:91
Belle2::ECLDsp::setbackgroundPhotonEnergy
void setbackgroundPhotonEnergy(double input)
Set pile-up photon energy.
Definition: ECLDsp.h:116
Belle2::ECLDsp::getTwoComponentTotalAmp
double getTwoComponentTotalAmp() const
get two comp total amp
Definition: ECLDsp.h:144
Belle2::ECLDsp::getNADCPoints
int getNADCPoints() const
Get number of ADC points.
Definition: ECLDsp.h:207
Belle2::ECLDsp::getTwoComponentSavedChi2
double getTwoComponentSavedChi2(TwoComponentFitType FitTypeIn) const
get two comp chi2 for a fit type see enum TwoComponentFitType in ECLDsp.h for description of fit type...
Definition: ECLDsp.h:165
Belle2::ECLDsp::m_TwoComponentTotalAmp
double m_TwoComponentTotalAmp
Two comp total amp.
Definition: ECLDsp.h:215
Belle2::ECLDsp::getCellId
int getCellId() const
Get Cell ID.
Definition: ECLDsp.h:129
Belle2::ECLDsp::m_TwoComponentHadronAmp
double m_TwoComponentHadronAmp
Two comp hadron amp.
Definition: ECLDsp.h:216
Belle2::ECLDsp::m_TwoComponentSavedChi2
double m_TwoComponentSavedChi2[3]
Two comp chi2 for each fit tried in reconstruction.
Definition: ECLDsp.h:219
Belle2::ECLDsp::photonHadronBackgroundPhoton
@ photonHadronBackgroundPhoton
photon + hadron template + pile-up photon fit
Definition: ECLDsp.h:45
Belle2::ECLDsp::setTwoComponentFitType
void setTwoComponentFitType(TwoComponentFitType ft)
Set fit type.
Definition: ECLDsp.h:124
Belle2::RelationsObject
RelationsInterface< TObject > RelationsObject
Provides interface for getting/adding relations to objects in StoreArrays.
Definition: RelationsObject.h:443
Belle2::ECLDsp::setTwoComponentSavedChi2
void setTwoComponentSavedChi2(TwoComponentFitType FitTypeIn, double input)
Set two comp chi2 for a fit type see enum TwoComponentFitType in ECLDsp.h for description of fit type...
Definition: ECLDsp.h:100
Belle2::ECLDsp::m_TwoComponentFitType
TwoComponentFitType m_TwoComponentFitType
offline fit hypothesis.
Definition: ECLDsp.h:224
Belle2::ECLDsp::m_TwoComponentChi2
double m_TwoComponentChi2
Two comp chi2.
Definition: ECLDsp.h:218
Belle2::ECLDsp::m_backgroundPhotonEnergy
double m_backgroundPhotonEnergy
Pile-up photon energy.
Definition: ECLDsp.h:222