PEGainSummary Class Reference

#include <PEGainSummary.h>

List of all members.

Public Member Functions

 PEGainSummary ()
virtual ~PEGainSummary ()
void AddNearEnd (const PulserSummary &ps, const PlexStripEndId &seid)
void AddFarEnd (const PulserSummary &ps, const PlexStripEndId &seid)
PlexStripEndId GetStripEndId () const
Float_t GetNearGain () const
Float_t GetFarGain () const
Float_t GetBestGain () const
Float_t GetNearError () const
Float_t GetFarError () const
Float_t GetBestError () const
Float_t GetProperNearGain () const
Float_t GetProperFarGain () const
Float_t GetProperBestGain () const
Float_t GetProperNearError () const
Float_t GetProperFarError () const
Float_t GetProperBestError () const

Private Member Functions

Int_t GetBest () const

Private Attributes

PlexStripEndId fSeid
Int_t fGotNear
Int_t fGotFar
Int_t fEncodedStrip
PulserSummary fNearEnd
PulserSummary fFarEnd

Detailed Description

Definition at line 16 of file PEGainSummary.h.


Constructor & Destructor Documentation

PEGainSummary::PEGainSummary (  ) 

Definition at line 17 of file PEGainSummary.cxx.

References Msg::kVerbose, and MSG.

00018    :fGotNear(0),fGotFar(0),fEncodedStrip(-1)//,fBestSide(-1)
00019 {
00020 
00021    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::PEGainSummary()\n";
00022 
00023 }

PEGainSummary::~PEGainSummary (  )  [virtual]

Definition at line 26 of file PEGainSummary.cxx.

References Msg::kVerbose, and MSG.

00027 {
00028 
00029    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::~PEGainSummary()\n";
00030 
00031 }


Member Function Documentation

void PEGainSummary::AddFarEnd ( const PulserSummary ps,
const PlexStripEndId seid 
)

Definition at line 53 of file PEGainSummary.cxx.

References PlexStripEndId::BuildPlnStripEndKey(), fEncodedStrip, fFarEnd, fGotFar, fSeid, Msg::kVerbose, Msg::kWarning, and MSG.

00054 {
00055    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::AddFarEnd()\n";
00056    
00057    if(fGotFar==1) {
00058       MSG("PEGain",Msg::kWarning) << "I've already got a far end for : "
00059                                   << seid << endl;
00060    }
00061    else {
00062       if(fEncodedStrip==-1) {
00063          fSeid=seid;
00064          fEncodedStrip=seid.BuildPlnStripEndKey();
00065       }
00066       else assert(seid.BuildPlnStripEndKey()==fEncodedStrip);
00067       fFarEnd=ps;
00068       fGotFar=1;
00069    }
00070 }

void PEGainSummary::AddNearEnd ( const PulserSummary ps,
const PlexStripEndId seid 
)

Definition at line 34 of file PEGainSummary.cxx.

References PlexStripEndId::BuildPlnStripEndKey(), fEncodedStrip, fGotNear, fNearEnd, fSeid, Msg::kVerbose, Msg::kWarning, and MSG.

00035 {
00036    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::AddNearEnd()\n";
00037    
00038    if(fGotNear==1) {
00039       MSG("PEGain",Msg::kWarning) << "I've already got a near end for : "
00040                                   << seid << endl;
00041    }
00042    else {
00043       if(fEncodedStrip==-1) {
00044          fSeid=seid;
00045          fEncodedStrip=seid.BuildPlnStripEndKey();
00046       }
00047       else assert(seid.BuildPlnStripEndKey()==fEncodedStrip);
00048       fNearEnd=ps;
00049       fGotNear=1;
00050    }
00051 }

Int_t PEGainSummary::GetBest (  )  const [private]

Definition at line 134 of file PEGainSummary.cxx.

References fFarEnd, fGotFar, fGotNear, fNearEnd, PulserSummary::GetEntries(), PulserSummary::GetMean(), Msg::kVerbose, and MSG.

Referenced by GetBestError(), and GetBestGain().

00134                                    {
00135    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::SetBest()\n";
00136    if(fGotNear) {
00137       if(fNearEnd.GetEntries()>200) {
00138          if(fGotFar) {
00139             if(fFarEnd.GetEntries()>200) {
00140                // Got two chances;
00141                Int_t nearNent=fNearEnd.GetEntries();
00142                Int_t farNent=fFarEnd.GetEntries();
00143                Float_t nentRatio=float(nearNent)/float(farNent);
00144                if(nentRatio>1.1) {
00145                   //fBestSide=1;
00146                   return 1;
00147                }
00148                if(nentRatio<0.9) {
00149                   //fBestSide=2;
00150                   return 2;
00151                }
00152                Float_t nearMean=fNearEnd.GetMean();
00153                Float_t farMean=fFarEnd.GetMean();
00154                if(nearMean<8000 && nearMean>800) {
00155                    return 1;
00156                }
00157                if(farMean<8000 && farMean>800) {
00158                }
00159                if(fabs(nearMean-5000.0)<fabs(farMean-5000.0)) {
00160                   //fBestSide=1;
00161                   return 1;
00162                }
00163                else {
00164                   //fBestSide=2;
00165                   return 2;
00166                }
00167             }
00168          }
00169          // Only Near
00170          //fBestSide=1;
00171          return 1;
00172       }
00173       
00174    }
00175    else if(fGotFar) {
00176       if(fFarEnd.GetEntries()>200) {
00177          //fBestSide=2;
00178          return 2;
00179       }
00180       // Only Far
00181       
00182    }
00183    //fBestSide=0;
00184    return 0;
00185 }

Float_t PEGainSummary::GetBestError (  )  const

Definition at line 203 of file PEGainSummary.cxx.

References GetBest(), GetFarError(), GetNearError(), Msg::kVerbose, and MSG.

Referenced by GetProperBestError().

00204 {
00205    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetBestError()\n";
00206    Int_t fBestSide=GetBest();
00207    //   if(fBestSide==-1) SetBest();
00208    if(fBestSide==1) {
00209       return GetNearError();
00210    }
00211    else if(fBestSide==2) {
00212       return GetFarError();
00213    }
00214    return -1;
00215    
00216 }

Float_t PEGainSummary::GetBestGain (  )  const

Definition at line 189 of file PEGainSummary.cxx.

References GetBest(), GetFarGain(), GetNearGain(), Msg::kVerbose, and MSG.

Referenced by GetProperBestGain().

00189                                          {
00190    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetBestGain()\n";
00191    Int_t fBestSide = GetBest();
00192    //   if(fBestSide==-1) SetBest();
00193    if(fBestSide==1) {
00194       return GetNearGain();
00195    }
00196    else if(fBestSide==2) {
00197       return GetFarGain();
00198    }
00199    return -1;
00200 }

Float_t PEGainSummary::GetFarError (  )  const

Definition at line 115 of file PEGainSummary.cxx.

References fFarEnd, fGotFar, PulserSummary::GetEntries(), PulserSummary::GetMean(), PulserSummary::GetRMS(), Msg::kVerbose, and MSG.

Referenced by GetBestError(), and GetProperFarError().

00116 {
00117    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetFarError()\n";
00118    if(fGotFar) {
00119       Float_t tempRms=fFarEnd.GetRMS();
00120       Float_t tempMean=fFarEnd.GetMean();
00121       Float_t tempNent=(float)fFarEnd.GetEntries();
00122       if(tempNent>1) {
00123          Float_t tempRmsErr=tempRms/sqrt(2.0*tempNent);
00124          Float_t tempMeanErr=tempRms/sqrt(tempNent-1);
00125          
00126          return sqrt(pow(2.0*tempRms/tempMean,2)*tempRmsErr*tempRmsErr
00127                      +pow(tempRms/tempMean,4)*tempMeanErr*tempMeanErr);
00128       }
00129       
00130    }
00131    return -1;
00132 }

Float_t PEGainSummary::GetFarGain (  )  const

Definition at line 84 of file PEGainSummary.cxx.

References fFarEnd, fGotFar, PulserSummary::GetMean(), PulserSummary::GetRMS(), Msg::kVerbose, and MSG.

Referenced by GetBestGain(), and GetProperFarGain().

00085 {
00086    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetFarGain()\n";
00087    if(fGotFar) {
00088       Float_t tempRms=fFarEnd.GetRMS();
00089       Float_t tempMean=fFarEnd.GetMean();
00090 
00091       return (tempRms*tempRms/tempMean);
00092    }
00093    return -1;
00094 }

Float_t PEGainSummary::GetNearError (  )  const

Definition at line 96 of file PEGainSummary.cxx.

References fGotNear, fNearEnd, PulserSummary::GetEntries(), PulserSummary::GetMean(), PulserSummary::GetRMS(), Msg::kVerbose, and MSG.

Referenced by GetBestError(), and GetProperNearError().

00097 {
00098    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetNearError()\n";
00099    if(fGotNear) {
00100       Float_t tempRms=fNearEnd.GetRMS();
00101       Float_t tempMean=fNearEnd.GetMean();
00102       Float_t tempNent=(float)fNearEnd.GetEntries();
00103       if(tempNent>1) {
00104          Float_t tempRmsErr=tempRms/sqrt(2.0*tempNent);
00105          Float_t tempMeanErr=tempRms/sqrt(tempNent-1);
00106          
00107          return sqrt(pow(2.0*tempRms/tempMean,2)*tempRmsErr*tempRmsErr
00108                      +pow(tempRms/tempMean,4)*tempMeanErr*tempMeanErr);
00109       }
00110       
00111    }
00112    return -1;
00113 }

Float_t PEGainSummary::GetNearGain (  )  const

Definition at line 72 of file PEGainSummary.cxx.

References fGotNear, fNearEnd, PulserSummary::GetMean(), PulserSummary::GetRMS(), Msg::kVerbose, and MSG.

Referenced by GetBestGain(), and GetProperNearGain().

00073 {
00074    MSG("PEGain",Msg::kVerbose) << "PEGainSummary::GetNearGain()\n";
00075    if(fGotNear) {
00076       Float_t tempRms=fNearEnd.GetRMS();
00077       Float_t tempMean=fNearEnd.GetMean();
00078 
00079       return (tempRms*tempRms/tempMean);
00080    }
00081    else return -1;
00082 }

Float_t PEGainSummary::GetProperBestError (  )  const

Definition at line 238 of file PEGainSummary.cxx.

References GetBestError().

00239 {
00240    return 0.8*GetBestError();
00241 }

Float_t PEGainSummary::GetProperBestGain (  )  const

Definition at line 226 of file PEGainSummary.cxx.

References GetBestGain().

00227 {
00228    return 0.8*GetBestGain();
00229 }

Float_t PEGainSummary::GetProperFarError (  )  const

Definition at line 234 of file PEGainSummary.cxx.

References GetFarError().

00235 {
00236    return 0.8*GetFarError();
00237 }

Float_t PEGainSummary::GetProperFarGain (  )  const

Definition at line 222 of file PEGainSummary.cxx.

References GetFarGain().

00223 {
00224    return 0.8*GetFarGain();
00225 }

Float_t PEGainSummary::GetProperNearError (  )  const

Definition at line 230 of file PEGainSummary.cxx.

References GetNearError().

00231 {
00232    return 0.8*GetNearError();
00233 }

Float_t PEGainSummary::GetProperNearGain (  )  const

Definition at line 218 of file PEGainSummary.cxx.

References GetNearGain().

00219 {
00220    return 0.8*GetNearGain();
00221 }

PlexStripEndId PEGainSummary::GetStripEndId (  )  const [inline]

Definition at line 24 of file PEGainSummary.h.

References fSeid.

00024 {return fSeid;}


Member Data Documentation

Definition at line 47 of file PEGainSummary.h.

Referenced by AddFarEnd(), and AddNearEnd().

Definition at line 49 of file PEGainSummary.h.

Referenced by AddFarEnd(), GetBest(), GetFarError(), and GetFarGain().

Int_t PEGainSummary::fGotFar [private]

Definition at line 46 of file PEGainSummary.h.

Referenced by AddFarEnd(), GetBest(), GetFarError(), and GetFarGain().

Int_t PEGainSummary::fGotNear [private]

Definition at line 45 of file PEGainSummary.h.

Referenced by AddNearEnd(), GetBest(), GetNearError(), and GetNearGain().

Definition at line 48 of file PEGainSummary.h.

Referenced by AddNearEnd(), GetBest(), GetNearError(), and GetNearGain().

Definition at line 43 of file PEGainSummary.h.

Referenced by AddFarEnd(), AddNearEnd(), and GetStripEndId().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1