AlcapDAQ  1
Data Structures | Public Member Functions | Protected Attributes | Private Attributes
TOctalFADCIsland Class Reference

#include <TOctalFADCIsland.h>

Data Structures

struct  TimeSortFADCIslands
 
struct  TOctalFADCIslandTimeComparator
 

Public Member Functions

 TOctalFADCIsland ()
 
 TOctalFADCIsland (int timestamp, const std::vector< int > &samples)
 
int GetTime () const
 
int GetNSamples () const
 
std::vector< int > & GetSampleVector ()
 
int GetMax (int first=0) const
 
int GetMax (int first, int last) const
 
int GetMaxBin (int first=0) const
 
int GetMaxBin (int first, int last) const
 
int GetMaxBinTime (int first=0) const
 
int GetMaxBinTime (int first, int last) const
 
double GetAverageMax (int nAv, int first=0) const
 
double GetAverageMax (int nAv, int first, int last) const
 
int GetCFBlockTime (int first=0) const
 
int GetCFBlockTime (int first, int last) const
 
int GetCFBin (int first=0) const
 
int GetCFBin (int first, int last) const
 
double GetAverage (int first=0) const
 
double GetAverage (int first, int last) const
 
double GetIntegral (int first=0) const
 
double GetIntegral (int first, int last) const
 
 TOctalFADCIsland (int timestamp, const std::vector< int > &samples, int channel)
 
int GetTime () const
 
int GetNSamples () const
 
int GetSample (int i) const
 
int GetFADCChannel () const
 
std::vector< int > & GetSampleVector ()
 
int GetMax (int first=0) const
 
int GetMax (int first, int last) const
 
int GetMaxBin (int first=0) const
 
int GetMaxBin (int first, int last) const
 
int GetMaxBinBlockTime (int first=0) const
 
int GetMaxBinBlockTime (int first, int last) const
 
double GetTimeNs () const
 
double GetAverageMax (int nAv, int first=0) const
 
double GetAverageMax (int nAv, int first, int last) const
 
bool GoodPulse (int shapTime, double clockPeriod, int level)
 
bool GoodPulse (int shapTime, double clockPeriod, int pedestal, int runnr, int level, int channel)
 
int GetCFBlockTime (int first=0) const
 
int GetCFBlockTime (int first, int last) const
 
int GetCFBin (int first=0) const
 
int GetCFBin (int first, int last) const
 
double GetAverage (int first=0) const
 
double GetAverage (int first, int last) const
 
double GetIntegral (int first=0) const
 
double GetIntegral (int first, int last) const
 
int FitGauss (int left, int right, int shapTime, double clockPeriod, int pedestal)
 
double GetMaxGauss () const
 
double GetMaxBinGauss () const
 
double GetChiSqrRed () const
 
void SetMaxGauss (double value)
 
void SetMaxBinGauss (double value)
 
void SetChiSqrRed (double value)
 
void SetPulseQuality (int value)
 
int GetPulseQuality () const
 

Protected Attributes

int fTime
 
std::vector< int > fData
 

Private Attributes

int fChannel
 
int fPulseQuality
 
double fmaxbinGauss
 
double fmaxGauss
 
double fchiSqrRed
 

Detailed Description

Timestamp and vector of ADC samples. This class is not specific to neutron detectors or Ge det. It should be useable for any of the Octal FADCs.

Timestamp and vector of ADC samples. This class is not specific to neutron detectors or Ge det. It should be useable for any of Fred's FADCs

Definition at line 10 of file TOctalFADCIsland.h.

Constructor & Destructor Documentation

TOctalFADCIsland::TOctalFADCIsland ( )

Definition at line 13 of file TOctalFADCIsland.cpp.

14  : fTime(0)
15 {}
TOctalFADCIsland::TOctalFADCIsland ( int  timestamp,
const std::vector< int > &  samples 
)
inline

Definition at line 14 of file TOctalFADCIsland.h.

15  : fTime(timestamp), fData(samples) {}
TOctalFADCIsland::TOctalFADCIsland ( int  timestamp,
const std::vector< int > &  samples,
int  channel 
)
inline

Definition at line 16 of file TOctalFADCIsland.h.

References fchiSqrRed, fmaxbinGauss, fmaxGauss, and fPulseQuality.

17  : fTime(timestamp), fData(samples), fChannel(channel){fmaxGauss = -1; fmaxbinGauss = -1; fchiSqrRed = -1;fPulseQuality = -1;}

Member Function Documentation

int TOctalFADCIsland::FitGauss ( int  left,
int  right,
int  shapTime,
double  clockPeriod,
int  pedestal 
)

Definition at line 223 of file TOctalFADCIsland.cpp.

References fData, GetMaxBin(), i, SetChiSqrRed(), SetMaxBinGauss(), SetMaxGauss(), and size.

224 {
225  int size = fData.size();
226  if( GetMaxBin() - left < 1) { return 0; }
227  if(GetMaxBin() + right > size -1) { return 0; }
228 
229  TH1I* hIsland = new TH1I("hIsland","The OctalFADCIsland as a Histogram instead of a vector",size,0,size);
230  for(int i = 0; i<size; i++) { hIsland->SetBinContent(i+1,fData[i]);}
231 
232  TF1* myG = new TF1("myG", "gaus(0)+[3]", GetMaxBin()-left,GetMaxBin()+right);
233  myG->SetParLimits(1, left+1., right-1.);
234  myG->SetParLimits(2, shapTime/(4.*clockPeriod), (shapTime*4.)/clockPeriod);
235  myG->FixParameter(3, pedestal*1.);
236  //myG->SetParLimits(3,octalfadc_parameters.pedestalGeHighGainchannel-500,octalfadc_parameters.pedestalGeHighGainchannel+100);
237 
238  hIsland->Fit("myG","RQ");
239 
240  double chiSqr = myG->GetChisquare();
241  double maxbin = myG->GetParameter(1);
242  double max = myG->GetMaximum();
243  int NDF = myG->GetNDF();
244 
245  SetChiSqrRed(chiSqr/NDF);
246  SetMaxBinGauss (maxbin);
247  SetMaxGauss(max);
248 
249  //printf("Size = %d Pulse Quality = %d Chi Sqr = %.1f NDF = %d Fitted amp = %f Amplitude = %d \n", size, GetPulseQuality(), myG->GetChisquare(), myG->GetNDF(),max,GetMax());
250 
251  delete hIsland;
252  delete myG;
253 
254  if(chiSqr/NDF > 5.){ return 0; }
255 
256  return 1;
257 }
double TOctalFADCIsland::GetAverage ( int  first = 0) const
inline

Definition at line 36 of file TOctalFADCIsland.h.

References fData, and GetAverage().

Referenced by GetAverage(), and GoodPulse().

36 {return GetAverage(first, fData.size()-1);}
double TOctalFADCIsland::GetAverage ( int  first,
int  last 
) const

Definition at line 108 of file TOctalFADCIsland.cpp.

References fData, i, and last.

109 {
110  if(last < first ){return -1.;}
111  if(first<0){first=0;}
112  if(last >= fData.size()){last = fData.size();}
113 
114  int sum = 0;
115  int N = 0;
116 
117  for(int i = first; i <= last; i++)
118  {
119  sum += fData[i];
120  N += 1;
121  }
122 
123  return static_cast<double>(sum)/N;
124 }
double TOctalFADCIsland::GetAverage ( int  first = 0) const
inline

Definition at line 52 of file TOctalFADCIsland.h.

References fData, and GetAverage().

Referenced by GetAverage().

52 {return GetAverage(first, fData.size()-1);}
double TOctalFADCIsland::GetAverage ( int  first,
int  last 
) const
double TOctalFADCIsland::GetAverageMax ( int  nAv,
int  first = 0 
) const
inline

Definition at line 28 of file TOctalFADCIsland.h.

References fData.

Referenced by TNaIHit::SetFromEnergyPulse(), and TNaIHit::SetFromTimingPulse().

28  {
29  return GetAverageMax(nAv,first,fData.size()-1); }
double TOctalFADCIsland::GetAverageMax ( int  nAv,
int  first,
int  last 
) const

Give the average value between two boundaries. It is the user responsibility to make sure that "first" and "last" are ok. Use GetNSamples for that. The function will return -1 for arguments out of range.

Definition at line 42 of file TOctalFADCIsland.cpp.

References fData, GetMaxBin(), and i.

43 {
44  if(last < first || last >= fData.size() || first < 0 || nAv < 0){
45  cerr << "TOctalFADCIsland::GetAverageMax() : Error! arguments out of range."
46  << endl;
47  }
48 
49  int maxbin = GetMaxBin(first,last);
50  int sum = *(std::max_element(fData.begin()+first,fData.begin()+last+1));
51  int skipped = 0;
52  int ind;
53 
54  for(int i=1; i<=nAv; i++)
55  {
56  ind = maxbin + static_cast<int>((i/2.+ 0.5)*pow(-1,i));
57  if(ind > first && ind < last){sum = sum + fData[ind];}
58  else{skipped++;}
59  }
60 
61  return static_cast<double>(sum)/(nAv+1.-skipped);
62 }
double TOctalFADCIsland::GetAverageMax ( int  nAv,
int  first = 0 
) const
inline

Definition at line 43 of file TOctalFADCIsland.h.

References fData, and GetAverageMax().

Referenced by GetAverageMax().

43 { return GetAverageMax(nAv,first,fData.size()-1); } //First argument is number of point around the maximum you want to average "0" should give the same result as the GetMax method, "2" averages the maximum with the sample left and right of it, i.e. an average of 3 points
double TOctalFADCIsland::GetAverageMax ( int  nAv,
int  first,
int  last 
) const
int TOctalFADCIsland::GetCFBin ( int  first = 0) const
inline

Definition at line 33 of file TOctalFADCIsland.h.

References fData, and GetCFBin().

Referenced by GetCFBin(), and GetCFBlockTime().

33 {return GetCFBin(first, fData.size()-1);}
int TOctalFADCIsland::GetCFBin ( int  first,
int  last 
) const

Constant fraction discrimination. This returns the sample where the pulse first crosses half-maximum.

Definition at line 85 of file TOctalFADCIsland.cpp.

References fData, GetMax(), GetMaxBin(), and value.

86 {
87  if(last < first || last >= fData.size() || first < 0){
88  cerr << "TOctalFADCIsland::GetCFBlockTime() : Error! arguments out of range."
89  << endl;
90  }
91 
92  // Take the non-zero pedestal into account
93  int max = GetMax(first,last) - fData[first];
94  int maxbin = GetMaxBin(first,last);
95  double halfmax = max/2.;
96  int constantFraction = first;
97  double value = -1.;
98 
99  while( value < halfmax && constantFraction < maxbin)
100  {
101  value = static_cast<double>(fData[constantFraction]);
102  constantFraction++;
103  }
104 
105  return constantFraction;
106 }
int TOctalFADCIsland::GetCFBin ( int  first = 0) const
inline

Definition at line 49 of file TOctalFADCIsland.h.

References fData, and GetCFBin().

Referenced by GetCFBin().

49 {return GetCFBin(first, fData.size()-1);}
int TOctalFADCIsland::GetCFBin ( int  first,
int  last 
) const
int TOctalFADCIsland::GetCFBlockTime ( int  first = 0) const
inline

Definition at line 31 of file TOctalFADCIsland.h.

References fData, and GetCFBlockTime().

Referenced by GetCFBlockTime(), and TNaIHit::SetFromTimingPulse().

31 {return GetCFBlockTime(first, fData.size()-1);}
int TOctalFADCIsland::GetCFBlockTime ( int  first,
int  last 
) const

Definition at line 73 of file TOctalFADCIsland.cpp.

References fData, GetCFBin(), and GetTime().

74 {
75  if(last < first || last >= fData.size() || first < 0){
76  cerr << "TOctalFADCIsland::GetCFBlockTime() : Error! arguments out of range."
77  << endl;
78  }
79  return GetCFBin(first,last)+GetTime();
80 }
int TOctalFADCIsland::GetCFBlockTime ( int  first = 0) const
inline

Definition at line 47 of file TOctalFADCIsland.h.

References fData, and GetCFBlockTime().

Referenced by GetCFBlockTime().

47 {return GetCFBlockTime(first, fData.size()-1);}
int TOctalFADCIsland::GetCFBlockTime ( int  first,
int  last 
) const
double TOctalFADCIsland::GetChiSqrRed ( ) const
inline

Definition at line 60 of file TOctalFADCIsland.h.

References fchiSqrRed.

60 {return fchiSqrRed;}
int TOctalFADCIsland::GetFADCChannel ( ) const
inline

Definition at line 22 of file TOctalFADCIsland.h.

References fChannel.

Referenced by GoodPulse(), TNaIHit::SetFromEnergyPulse(), TNaIHit::SetFromTimingPulse(), and TNaIHit::TNaIHit().

22 { return fChannel; }
double TOctalFADCIsland::GetIntegral ( int  first = 0) const
inline

Definition at line 38 of file TOctalFADCIsland.h.

References fData, and GetIntegral().

Referenced by GetIntegral().

38 {return GetIntegral(first, fData.size()-1);}
double TOctalFADCIsland::GetIntegral ( int  first,
int  last 
) const

Definition at line 126 of file TOctalFADCIsland.cpp.

References fData, i, and last.

127 {
128  if(last < first ){return -1.;}
129  if(first<0) { first=0; }
130  if(last >= fData.size()) { last = fData.size() - 1; }
131 
132  int sum = 0;
133 
134  for(int i = first; i <= last; i++)
135  {
136  sum += fData[i];
137  }
138 
139  return static_cast<double>(sum);
140 }
double TOctalFADCIsland::GetIntegral ( int  first = 0) const
inline

Definition at line 54 of file TOctalFADCIsland.h.

References fData, and GetIntegral().

Referenced by GetIntegral().

54 {return GetIntegral(first, fData.size()-1);}
double TOctalFADCIsland::GetIntegral ( int  first,
int  last 
) const
int TOctalFADCIsland::GetMax ( int  first = 0) const
inline

Definition at line 21 of file TOctalFADCIsland.h.

References fData, and GetMax().

Referenced by GetCFBin(), GetMax(), GoodPulse(), TNaIHit::SetFromEnergyPulse(), and TNaIHit::SetFromTimingPulse().

21 { return GetMax(first,fData.size()-1); }
int TOctalFADCIsland::GetMax ( int  first,
int  last 
) const

Definition at line 17 of file TOctalFADCIsland.cpp.

References fData.

18 {
19  if(last < first || last >= fData.size() || first < 0){
20  cerr << "TOctalFADCIsland::GetMax() : Error! arguments out of range." << endl;
21  }
22  // max_element returns an iterator to the maximum element in the range.
23  return *(std::max_element(fData.begin() + first, fData.begin() + last + 1));
24 }
int TOctalFADCIsland::GetMax ( int  first = 0) const
inline

Definition at line 28 of file TOctalFADCIsland.h.

References fData, and GetMax().

Referenced by GetMax().

28 { return GetMax(first,fData.size()-1); } //Make these two steps so you only need one implementation. Giving no argument just finds the maximum. Still, you can ask for the max between "first" and "last" sample
int TOctalFADCIsland::GetMax ( int  first,
int  last 
) const
int TOctalFADCIsland::GetMaxBin ( int  first = 0) const
inline

Definition at line 23 of file TOctalFADCIsland.h.

References fData, and GetMaxBin().

Referenced by FitGauss(), GetAverageMax(), GetCFBin(), GetMaxBin(), GetMaxBinBlockTime(), GetMaxBinTime(), and GoodPulse().

23 { return GetMaxBin(first, fData.size()-1);}
int TOctalFADCIsland::GetMaxBin ( int  first,
int  last 
) const

Definition at line 26 of file TOctalFADCIsland.cpp.

References fData.

27 {
28  if(last < first || last >= fData.size() || first < 0)
29  {
30  cout << "first = " << first << " last : " << last << " size : " << fData.size() << endl;
31  cerr << "TOctalFADCIsland::GetMaxBin() : Error! arguments out of range." << endl;
32  }
33  return std::max_element(fData.begin()+first,fData.begin()+last+1)
34  - fData.begin();
35 }
int TOctalFADCIsland::GetMaxBin ( int  first = 0) const
inline

Definition at line 30 of file TOctalFADCIsland.h.

References fData, and GetMaxBin().

Referenced by GetMaxBin().

30 { return GetMaxBin(first, fData.size()-1);}
int TOctalFADCIsland::GetMaxBin ( int  first,
int  last 
) const
int TOctalFADCIsland::GetMaxBinBlockTime ( int  first = 0) const
inline

Definition at line 32 of file TOctalFADCIsland.h.

References fData, and GetMaxBinBlockTime().

Referenced by GetMaxBinBlockTime(), and TNaIHit::SetFromEnergyPulse().

32 {return GetMaxBinBlockTime(first, fData.size()-1);}
int TOctalFADCIsland::GetMaxBinBlockTime ( int  first,
int  last 
) const

Definition at line 62 of file TOctalFADCIsland.cpp.

References fData, GetMaxBin(), and GetTime().

63 {
64  if(last < first || last >= fData.size() || first < 0){
65  cerr << "TOctalFADCIsland::GetMaxBinBlockTime() : Error! arguments out of range." << endl;
66  }
67  return GetTime() + GetMaxBin(first,last);
68 }
double TOctalFADCIsland::GetMaxBinGauss ( ) const
inline

Definition at line 59 of file TOctalFADCIsland.h.

References fmaxbinGauss.

59 {return fmaxbinGauss;}
int TOctalFADCIsland::GetMaxBinTime ( int  first = 0) const
inline

Definition at line 25 of file TOctalFADCIsland.h.

References fData, and GetMaxBinTime().

Referenced by GetMaxBinTime().

25 { return GetMaxBinTime(first, fData.size()-1);}
int TOctalFADCIsland::GetMaxBinTime ( int  first,
int  last 
) const

Definition at line 64 of file TOctalFADCIsland.cpp.

References fData, GetMaxBin(), and GetTime().

65 {
66  if(last < first || last >= fData.size() || first < 0){
67  cerr << "TOctalFADCIsland::GetMaxBinTime() : Error! arguments out of range."
68  << endl;
69  }
70  return GetTime() + GetMaxBin(first,last);
71 }
double TOctalFADCIsland::GetMaxGauss ( ) const
inline

Definition at line 58 of file TOctalFADCIsland.h.

References fmaxGauss.

58 {return fmaxGauss;}
int TOctalFADCIsland::GetNSamples ( ) const
inline

Definition at line 18 of file TOctalFADCIsland.h.

References fData.

Referenced by TOctalFADCBankReader::StitchIslands().

18 { return fData.size(); }
int TOctalFADCIsland::GetNSamples ( ) const
inline

Definition at line 20 of file TOctalFADCIsland.h.

References fData.

20 { return fData.size(); }
int TOctalFADCIsland::GetPulseQuality ( ) const
inline

Definition at line 67 of file TOctalFADCIsland.h.

References fPulseQuality.

Referenced by TNaIHit::SetFromTimingPulse().

67 {return fPulseQuality;}
int TOctalFADCIsland::GetSample ( int  i) const
inline

Definition at line 21 of file TOctalFADCIsland.h.

References fData, and i.

21 { return fData[i]; }
std::vector<int>& TOctalFADCIsland::GetSampleVector ( )
inline

Definition at line 19 of file TOctalFADCIsland.h.

References fData.

19 { return fData; }
std::vector<int>& TOctalFADCIsland::GetSampleVector ( )
inline

Definition at line 26 of file TOctalFADCIsland.h.

References fData.

26 { return fData; }
int TOctalFADCIsland::GetTime ( ) const
inline
int TOctalFADCIsland::GetTime ( ) const
inline

Definition at line 19 of file TOctalFADCIsland.h.

References fTime.

19 { return fTime; }
double TOctalFADCIsland::GetTimeNs ( ) const

Definition at line 120 of file TOctalFADCIsland.cpp.

References fChannel, fTime, and octalfadc_parameters.

Referenced by TOctalFADCIsland::TOctalFADCIslandTimeComparator::operator()().

121 {
122  double period = octalfadc_parameters.kClockPeriod[fChannel];
123  return fTime*period;
124 }
bool TOctalFADCIsland::GoodPulse ( int  shapTime,
double  clockPeriod,
int  level 
)

Definition at line 145 of file TOctalFADCIsland.cpp.

References channel, fData, GetFADCChannel(), GetMax(), GetMaxBin(), octalfadc_parameters, and SetPulseQuality().

146 {
147  int secondSample = 1;
148  int oneButLast = fData.size() - 1;
149  int maxbin = GetMaxBin();
150  int channel = GetFADCChannel();
151  int threshold = octalfadc_parameters.threshold[channel];
152 
153  if(fData.size()*clockPeriod < static_cast<double>(shapTime) && level >= 1){SetPulseQuality(1);return false;} //A good pulse is longer then the shaping time. For a non-shaped PMT pulse you just can send the width,
154 
155  //This doesn`t work so well. Energy samples which are missing a piece, but have a nice maximum, are not accepted. Also good timing pulses with an undershoot don`t make it.
156  //else if( abs(fData[secondSample] - fData[oneButLast] ) > 50 && level >= 2){return false;} //The first and the last few samples should be about the same value. "50" is somewhat arbitary
157 
158  //Alternative: asking that the maximum doesn`t set at the edge (12.5% on each side) of the island
159  else if( ( static_cast<double>(maxbin) < fData.size()/12. || static_cast<double>(maxbin) > 11*fData.size()/12. ) && level >=2) { SetPulseQuality(2);return false;}
160 
161  else if( ( GetMax() < threshold && level >=3 )) {SetPulseQuality(3);return false;}
162 
163  else if( abs(*(std::max_element(fData.begin(), fData.begin() + fData.size())) - *(std::max_element(fData.begin(), fData.begin() + fData.size()) + 1)) > 50 && level >= 4){SetPulseQuality(4);return false;} //eleminating spikes, again the "50" is arbitary. Might be dangerous for very sharp PMT pulses
164 
165  else{SetPulseQuality(0);return true;}
166 
167 }
bool TOctalFADCIsland::GoodPulse ( int  shapTime,
double  clockPeriod,
int  pedestal,
int  runnr,
int  level,
int  channel 
)

Definition at line 170 of file TOctalFADCIsland.cpp.

References fData, GetAverage(), GetMax(), GetMaxBin(), ped, and SetPulseQuality().

171 {
172  int secondSample = 1;
173  int oneButLast = fData.size() - 1;
174  int maxbin = GetMaxBin();
175  double max = static_cast<double>(GetMax());
176  double leftAv = GetAverage(maxbin-40,maxbin-30);
177  double rightAv = GetAverage(maxbin+30,maxbin+40);
178  double totalAv = GetAverage();
179  double pedestal = static_cast<double>(ped);
180 
181  double ampCut_a = 0;
182  double ampCut_b = 0;
183  double avCut_a = 1.;
184  double avCut_b = 0.;//"_a" is for the Drop Maximum method, "_b" is for the Island Average method
185 
186  if((runnr >= 51683) &&(runnr <= 51984))
187  {
188  if(channel == 1){ampCut_a = 2500; avCut_a = 0.04; ampCut_b = 2700; avCut_b = 0.75;} //channel 1 = HG, channel 2 = LG
189  if(channel == 2){ampCut_a = 1380; avCut_a = 0.032; ampCut_b = 1385; avCut_b = 0.975;}
190  }
191  if((runnr >= 51985) &&(runnr <= 52280))
192  {
193  if(channel == 1){ampCut_a = 2500; avCut_a = 0.04; ampCut_b = 2500; avCut_b = 0.8;}
194  if(channel == 2){ampCut_a = 1500; avCut_a = 0.022; ampCut_b = 1510; avCut_b = 0.935;}
195  //if(channel == 2){ampCut_a = 1500; avCut_a = 0.022; ampCut_b = 1510; avCut_b = 0.935;}
196  }
197 
198  if(fData.size()*clockPeriod < static_cast<double>(shapTime) && level >= 1){SetPulseQuality(1);return false;} //A good pulse is longer then the shaping time. For a non-shaped PMT pulse you just can send the width,
199 
200  //This doesn`t work so well. Energy samples which are missing a piece, but have a nice maximum, are not accepted. Also good timing pulses with an undershoot don`t make it.
201  //else if( abs(fData[secondSample] - fData[oneButLast] ) > 50 && level >= 2){return false;} //The first and the last few samples should be about the same value. "50" is somewhat arbitary
202 
203  //Alternative: asking that the maximum doesn`t set at the edge (12.5% on each side) of the island
204  else if( ( static_cast<double>(maxbin) < fData.size()/12. || static_cast<double>(maxbin) > 11*fData.size()/12. ) && level >=2){ SetPulseQuality(2);return false;}
205 
206  else if( abs(*(std::max_element(fData.begin(), fData.begin() + fData.size())) - *(std::max_element(fData.begin(), fData.begin() + fData.size()) + 1)) > 50 && level >= 3){SetPulseQuality(3);return false;} //eleminating spikes, again the "50" is arbitary. Might be dangerous for very sharp PMT pulses
207 
208  //This checks if the pulse drops fast enough next to the maximum
209  else if( level >=4 && ( fabs((leftAv - max)/(max - pedestal)) < avCut_a && max > ampCut_a) ){SetPulseQuality(4);return false;}
210  else if( level >=4 && ( fabs((rightAv - max)/(max - pedestal)) < avCut_a && max > ampCut_a) ){SetPulseQuality(4);return false;}
211 
212  //checks if the Average (~integral) is consistent with the amplitude
213  else if( level >=5 && ( totalAv/max > avCut_b && max > ampCut_b ) ) {SetPulseQuality(5);return false;}
214 
215 
216  else{SetPulseQuality(0);return true;}
217 //printf("max = %f,avCut_a = %f, ampCut_a = %f, Figure of Merit (R) = %f\n",max ,avCut_a,ampCut_a,fabs((rightAv - max)/(max - pedestal)));
218 //printf("max = %f, avCut_a = %f, ampCut_a = %f, Figure of Merit (L) = %f\n",max ,avCut_a,ampCut_a,fabs((leftAv - max)/(max - pedestal)));
219 //printf("Max = %f, Pedestal = %f, LeftAv = %f, Figure of merit = %f \n", max,pedestal,leftAv,fabs((leftAv - max)/(max - pedestal)) );printf("Max = %f, Pedestal = %f, RightAv = %f, Figure of merit = %f \n", max,pedestal, rightAv,fabs((rightAv - max)/(max - pedestal)) );
220 
221 }
void TOctalFADCIsland::SetChiSqrRed ( double  value)
inline

Definition at line 64 of file TOctalFADCIsland.h.

References fchiSqrRed, and value.

Referenced by FitGauss().

64 {fchiSqrRed = value;}
void TOctalFADCIsland::SetMaxBinGauss ( double  value)
inline

Definition at line 63 of file TOctalFADCIsland.h.

References fmaxbinGauss, and value.

Referenced by FitGauss().

void TOctalFADCIsland::SetMaxGauss ( double  value)
inline

Definition at line 62 of file TOctalFADCIsland.h.

References fmaxGauss, and value.

Referenced by FitGauss().

62 {fmaxGauss = value;}
void TOctalFADCIsland::SetPulseQuality ( int  value)
inline

Definition at line 66 of file TOctalFADCIsland.h.

References fPulseQuality, and value.

Referenced by GoodPulse().

Field Documentation

int TOctalFADCIsland::fChannel
private

Definition at line 88 of file TOctalFADCIsland.h.

Referenced by GetFADCChannel(), and GetTimeNs().

double TOctalFADCIsland::fchiSqrRed
private

Definition at line 91 of file TOctalFADCIsland.h.

Referenced by GetChiSqrRed(), SetChiSqrRed(), and TOctalFADCIsland().

std::vector< int > TOctalFADCIsland::fData
protected
double TOctalFADCIsland::fmaxbinGauss
private

Definition at line 91 of file TOctalFADCIsland.h.

Referenced by GetMaxBinGauss(), SetMaxBinGauss(), and TOctalFADCIsland().

double TOctalFADCIsland::fmaxGauss
private

Definition at line 91 of file TOctalFADCIsland.h.

Referenced by GetMaxGauss(), SetMaxGauss(), and TOctalFADCIsland().

int TOctalFADCIsland::fPulseQuality
private

Definition at line 89 of file TOctalFADCIsland.h.

Referenced by GetPulseQuality(), SetPulseQuality(), and TOctalFADCIsland().

int TOctalFADCIsland::fTime
protected

Definition at line 50 of file TOctalFADCIsland.h.

Referenced by GetTime(), and GetTimeNs().


The documentation for this class was generated from the following files: