#include <LIChannel.h>
Public Member Functions | |
| LIChannel () | |
| ~LIChannel () | |
| void | AddEntry (Int_t entries, Float_t mean, Float_t rms) |
| void | Clean () |
| Float_t | GetRms () |
| void | SetChannelId (RawChannelId channelId) |
| void | SetEntry (Int_t entries, Float_t mean, Float_t rms) |
| void | SetMean (Float_t mean) |
| void | SetNumEntries (Int_t numEntries) |
| void | SetRms (Float_t rms) |
| void | SetSummaryCounter (Int_t counts) |
| RawChannelId | GetChannelId () |
| RawChannelId | GetRawChannelId () |
| Float_t | GetMean () |
| Int_t | GetNumEntries () |
| Int_t | GetSummaryCounter () |
Private Attributes | |
| RawChannelId | fChannelId |
| Double_t | fMean |
| Int_t | fNumEntries |
| Double_t | fRms |
| Double_t | fSigma1 |
| Double_t | fSigma2 |
| Int_t | fSummaryCounter |
|
|
Definition at line 29 of file LIChannel.cxx. References fMean, fNumEntries, fRms, fSigma1, fSigma2, and fSummaryCounter. 00030 {
00031 //initialise variables
00032 fMean=0;
00033 fNumEntries=0;
00034 fRms=0;
00035 fSigma1=0;
00036 fSigma2=0;
00037 fSummaryCounter=0;
00038 }
|
|
|
Definition at line 41 of file LIChannel.cxx. 00042 {
00043 //nothing
00044 }
|
|
||||||||||||||||
|
Definition at line 120 of file LIChannel.cxx. References fMean, fNumEntries, fSigma1, fSigma2, fSummaryCounter, MSG, and pow(). 00122 {
00123 //convert to double to preserve precision
00124 Double_t rms=static_cast<Double_t>(rmsInput);
00125 Double_t mean=static_cast<Double_t>(meanInput);
00126
00127 MSG("LIChannel",Msg::kVerbose)
00128 <<" ent="<<entries<<", mean="<<meanInput<<", rms="<<rmsInput
00129 <<endl;
00130
00131 //protect against fpe
00132 if(entries>0){
00133 //calcuate the sum of the sq of the new mean and the new rms
00134 //and weight it by the number of new entries
00135 fSigma1+=entries*(pow(rms,2)+pow(mean,2));
00136
00137 //calculate weighted sum of all the means
00138 fSigma2+=mean*entries;
00139
00140 //calculate mean by weighting existing mean and new mean
00141 fMean=fMean*fNumEntries/(fNumEntries+entries)+
00142 mean*entries/(fNumEntries+entries);
00143
00144 //sum the number of entries in this channel
00145 fNumEntries+=entries;
00146
00147 //count the number of summaries included
00148 fSummaryCounter++;
00149 }
00150 }
|
|
|
Definition at line 62 of file LIChannel.cxx. References fChannelId, fMean, fNumEntries, fRms, fSigma1, fSigma2, and fSummaryCounter. 00063 {
00064 //reset all variables
00065 fNumEntries=0;
00066 fMean=0.;
00067 fRms=0.;
00068 fSummaryCounter=0;
00069 fSigma1=0;
00070 fSigma2=0;
00071 fChannelId=RawChannelId();//set to default
00072 }
|
|
|
Definition at line 45 of file LIChannel.h. 00045 {return fChannelId;}
|
|
|
Definition at line 47 of file LIChannel.h. 00047 {return static_cast<Float_t>(fMean);}
|
|
|
Definition at line 48 of file LIChannel.h. 00048 {return fNumEntries;}
|
|
|
Definition at line 46 of file LIChannel.h. Referenced by operator<(), and operator==(). 00046 {return fChannelId;}
|
|
|
Definition at line 87 of file LIChannel.cxx. References fMean, fNumEntries, fRms, fSigma1, fSigma2, MSG, and pow(). 00088 {
00089 //calcualte the rms from the sum of
00090 //1.) the weighted sum of the (sq of the new mean plus the sq of the
00091 // new rms)
00092 //2.) the weighted sum of all the means
00093
00094 //protect against fpe
00095 if (fNumEntries==0) return fRms;
00096
00097 //calculate averages
00098 Double_t avSigma1=fSigma1/fNumEntries;
00099 Double_t avSigma2Sqd=pow(fSigma2/fNumEntries,2);
00100
00101 //calculate average rms if possible
00102 if (avSigma1>=avSigma2Sqd){
00103 fRms=sqrt(avSigma1-avSigma2Sqd);
00104 }
00105 else{//would be imaginary
00106 fRms=0;
00107 MSG("LIChannel",Msg::kVerbose)
00108 << "Zero rms channel (avSigma1="<<avSigma1
00109 <<" < avSigma2Sqd="<<avSigma2Sqd<<")"
00110 <<", ent="<<fNumEntries
00111 <<", fMean="<<fMean
00112 <<", fRms="<<fRms
00113 << endl;
00114 }
00115 return static_cast<Float_t>(fRms);
00116 }
|
|
|
Definition at line 49 of file LIChannel.h. 00049 {return fSummaryCounter;}
|
|
|
Definition at line 37 of file LIChannel.h. 00037 {fChannelId=channelId;}
|
|
||||||||||||||||
|
Definition at line 76 of file LIChannel.cxx. References fMean, fNumEntries, fRms, and fSummaryCounter. 00078 {
00079 fNumEntries=entries;
00080 fMean=static_cast<Double_t>(mean);
00081 fRms=static_cast<Double_t>(rms);
00082 fSummaryCounter=1;
00083 }
|
|
|
Definition at line 39 of file LIChannel.h. 00039 {fMean=static_cast<Double_t>(mean);}
|
|
|
Definition at line 40 of file LIChannel.h. 00040 {fNumEntries=numEntries;}
|
|
|
Definition at line 41 of file LIChannel.h. 00041 {fRms=static_cast<Double_t>(rms);}
|
|
|
Definition at line 42 of file LIChannel.h. 00042 {fSummaryCounter=counts;}
|
|
|
Definition at line 53 of file LIChannel.h. Referenced by Clean(). |
|
|
Definition at line 54 of file LIChannel.h. Referenced by AddEntry(), Clean(), GetRms(), LIChannel(), and SetEntry(). |
|
|
Definition at line 55 of file LIChannel.h. Referenced by AddEntry(), Clean(), GetRms(), LIChannel(), and SetEntry(). |
|
|
Definition at line 56 of file LIChannel.h. Referenced by Clean(), GetRms(), LIChannel(), and SetEntry(). |
|
|
Definition at line 57 of file LIChannel.h. Referenced by AddEntry(), Clean(), GetRms(), and LIChannel(). |
|
|
Definition at line 58 of file LIChannel.h. Referenced by AddEntry(), Clean(), GetRms(), and LIChannel(). |
|
|
Definition at line 59 of file LIChannel.h. Referenced by AddEntry(), Clean(), LIChannel(), and SetEntry(). |
1.3.9.1