PulserSummary Class Reference

#include <PulserSummary.h>

List of all members.

Public Member Functions

 PulserSummary ()
virtual ~PulserSummary ()
void Add (RawLIAdcSummary &from, const PlexPinDiodeId &pinid)
void AddDigit (RawDigit &from, const PlexPinDiodeId &pinid)
void Add (RawLIAdcSummary &from, const PlexStripEndId &seid)
void AddDigit (RawDigit &from, const PlexStripEndId &seid)
void AddDigit (PulserNearDigit &from, const PlexStripEndId &seid)
void SetPinDiodeId (PlexPinDiodeId pin)
void Add (RawLIAdcSummary &)
void AddDigit (RawDigit &)
void AddDigit (PulserNearDigit &)
void Finish (int numTriggers)
UInt_t GetChannel () const
Float_t GetMean () const
Float_t GetRMS () const
Float_t GetError () const
Int_t GetEntries () const
Int_t GetTriggers () const
Float_t GetMeanZeroCorr () const
Float_t GetRMSZeroCorr () const
Float_t GetErrorZeroCorr () const
PlexPinDiodeId GetPinDiodeId () const
PlexStripEndId GetStripEndId () const

Private Attributes

UInt_t fChannel
Float_t fRMS
Float_t fMean
Float_t fRMSZC
Float_t fMeanZC
Float_t fMeanSquare
Int_t fNumEntries
Int_t fNumTriggers
PlexStripEndId fSEId
PlexPinDiodeId fPinId
ReadoutType::Readout_t fReadoutType

Detailed Description

Definition at line 41 of file PulserSummary.h.


Constructor & Destructor Documentation

PulserSummary::PulserSummary (  ) 

Definition at line 49 of file PulserSummary.cxx.

References Msg::kVerbose, and MSG.

00050 {
00051   MSG("Pulser",Msg::kVerbose) << "PulserSummary ctor\n";
00052   fMean=0;
00053   fMeanSquare=0;
00054   fRMS=0;
00055   fNumEntries=0;
00056   fChannel=0; // empty object has channel 0
00057 }

PulserSummary::~PulserSummary (  )  [virtual]

Definition at line 59 of file PulserSummary.cxx.

00060 {
00061 
00062 }


Member Function Documentation

void PulserSummary::Add ( RawLIAdcSummary from  ) 

Definition at line 102 of file PulserSummary.cxx.

References fChannel, fMean, fMeanSquare, fNumEntries, fSEId, RawLIAdcSummary::GetChannel(), RawChannelId::GetEncoded(), PlexStripEndId::GetEnd(), RawLIAdcSummary::GetEntries(), RawLIAdcSummary::GetMean(), PlexPlaneId::GetPlane(), RawLIAdcSummary::GetRms(), PlexStripEndId::GetStrip(), Msg::kVerbose, and MSG.

00103 {
00104    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00105                                << " and Channel is: " << from.GetChannel()
00106                                << endl; 
00107    if (fChannel==0) {
00108       fChannel=from.GetChannel().GetEncoded();
00109    } 
00110    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00111                                << " and Channel is: " << from.GetChannel()
00112                               << endl; 
00113   assert(from.GetChannel().GetEncoded()==fChannel);
00114   Int_t tempEnd=(int)fSEId.GetEnd();
00115   if(fSEId.GetPlane()==10 && fSEId.GetStrip()==4 && tempEnd==1) {
00116      MSG("Pulser",Msg::kVerbose) << "My Channel " 
00117                                  << "\tMean: " << from.GetMean()
00118                                  << "\tRMS: " <<  from.GetRms()
00119                                  << "\tEntries: " << from.GetEntries() << endl;
00120   }
00121 
00122  
00123     MSG("Pulser",Msg::kVerbose) << "PulserSummary::Add() Got channel "<<fChannel<<endl;
00124     fMean = 
00125       fNumEntries*(1.0/(fNumEntries + from.GetEntries())) * fMean 
00126       + from.GetEntries()*(1.0/(fNumEntries + from.GetEntries())) 
00127       * from.GetMean();
00128     fMeanSquare = 
00129       fNumEntries*(1.0/(fNumEntries + from.GetEntries())) *fMeanSquare
00130       + from.GetEntries()*(1.0/(fNumEntries + from.GetEntries())) 
00131       * (float(from.GetRms())*from.GetRms()+float(from.GetMean())*from.GetMean());
00132     fNumEntries +=from.GetEntries();
00133 }

void PulserSummary::Add ( RawLIAdcSummary from,
const PlexStripEndId seid 
)

Definition at line 81 of file PulserSummary.cxx.

References Add(), fReadoutType, fSEId, and ReadoutType::kScintStrip.

00082 {
00083   fSEId = seid;
00084   fReadoutType = ReadoutType::kScintStrip;
00085   Add(from);
00086 }

void PulserSummary::Add ( RawLIAdcSummary from,
const PlexPinDiodeId pinid 
)

Definition at line 64 of file PulserSummary.cxx.

References fMean, fNumEntries, fNumTriggers, fPinId, fReadoutType, ReadoutType::kPinDiode, Msg::kVerbose, and MSG.

Referenced by PulserSummaryList::Add(), and Add().

00065 {
00066   fPinId = pinid;
00067   fReadoutType = ReadoutType::kPinDiode;
00068   MSG("Pulser",Msg::kVerbose) << "PIN "<<pinid<<" has "<<fMean<<" "<<fNumEntries<<" "<<fNumTriggers<<endl;
00069   Add(from);
00070 }

void PulserSummary::AddDigit ( PulserNearDigit from  ) 

Definition at line 157 of file PulserSummary.cxx.

References fChannel, fMean, fMeanSquare, fNumEntries, PulserNearDigit::GetADC(), PulserNearDigit::GetChannel(), RawChannelId::GetEncoded(), Msg::kVerbose, and MSG.

00158 {
00159    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00160                                << " and Channel is: " << from.GetChannel()
00161                                << endl; 
00162    if (fChannel==0) {
00163       fChannel=from.GetChannel().GetEncoded();
00164    } 
00165    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00166                                << " and Channel is: " << from.GetChannel()
00167                                << endl; 
00168    assert(from.GetChannel().GetEncoded()==fChannel);
00169    //Int_t tempEnd=(int)fSEId.GetEnd();
00170    MSG("Pulser",Msg::kVerbose) 
00171       << "PulserSummary::Add() Got channel "<<fChannel<<endl;
00172    fMean = (float(fNumEntries)/(float(fNumEntries)+1.0))*fMean +
00173       (1.0/(float(fNumEntries)+1.0))*from.GetADC();
00174    fMeanSquare = (float(fNumEntries)/(float(fNumEntries)+1.0))*fMeanSquare +
00175       (1.0/(float(fNumEntries)+1.0))*(from.GetADC()*from.GetADC());
00176    fNumEntries ++;
00177 }

void PulserSummary::AddDigit ( RawDigit from  ) 

Definition at line 135 of file PulserSummary.cxx.

References fChannel, fMean, fMeanSquare, fNumEntries, RawDigit::GetADC(), RawDigit::GetChannel(), RawChannelId::GetEncoded(), Msg::kVerbose, and MSG.

00136 {
00137    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00138                                << " and Channel is: " << from.GetChannel()
00139                                << endl; 
00140    if (fChannel==0) {
00141       fChannel=from.GetChannel().GetEncoded();
00142    } 
00143    MSG("Pulser",Msg::kVerbose) << "fChannel " << RawChannelId(fChannel)
00144                                << " and Channel is: " << from.GetChannel()
00145                                << endl; 
00146    assert(from.GetChannel().GetEncoded()==fChannel);
00147    //Int_t tempEnd=(int)fSEId.GetEnd();
00148    MSG("Pulser",Msg::kVerbose) 
00149       << "PulserSummary::Add() Got channel "<<fChannel<<endl;
00150    fMean = (float(fNumEntries)/(float(fNumEntries)+1.0))*fMean +
00151       (1.0/(float(fNumEntries)+1.0))*from.GetADC();
00152    fMeanSquare = (float(fNumEntries)/(float(fNumEntries)+1.0))*fMeanSquare +
00153       (1.0/(float(fNumEntries)+1.0))*(from.GetADC()*from.GetADC());
00154    fNumEntries ++;
00155 }

void PulserSummary::AddDigit ( PulserNearDigit from,
const PlexStripEndId seid 
)

Definition at line 95 of file PulserSummary.cxx.

References AddDigit(), fReadoutType, fSEId, and ReadoutType::kScintStrip.

00096 {
00097   fSEId = seid;
00098   fReadoutType = ReadoutType::kScintStrip;
00099   AddDigit(from);
00100 }

void PulserSummary::AddDigit ( RawDigit from,
const PlexStripEndId seid 
)

Definition at line 88 of file PulserSummary.cxx.

References AddDigit(), fReadoutType, fSEId, and ReadoutType::kScintStrip.

00089 {
00090   fSEId = seid;
00091   fReadoutType = ReadoutType::kScintStrip;
00092   AddDigit(from);
00093 }

void PulserSummary::AddDigit ( RawDigit from,
const PlexPinDiodeId pinid 
)

Definition at line 72 of file PulserSummary.cxx.

References fMean, fNumEntries, fNumTriggers, fPinId, fReadoutType, ReadoutType::kPinDiode, Msg::kVerbose, and MSG.

Referenced by PulserFromRawSummaryList::Add(), and AddDigit().

00074 {
00075    fPinId = pinid;
00076    fReadoutType = ReadoutType::kPinDiode;
00077    MSG("Pulser",Msg::kVerbose) << "PIN "<<pinid<<" has "<<fMean<<" "<<fNumEntries<<" "<<fNumTriggers<<endl;
00078    AddDigit(from);
00079 }

void PulserSummary::Finish ( int  numTriggers  ) 

Definition at line 179 of file PulserSummary.cxx.

References fChannel, fMean, fMeanSquare, fMeanZC, fNumEntries, fNumTriggers, fRMS, fRMSZC, Msg::kVerbose, Munits::ms, and MSG.

Referenced by PulserSummaryList::Finish(), and PulserFromRawSummaryList::Finish().

00180 {
00181    
00182   if ((fMeanSquare - fMean*fMean)>1) {
00183     fRMS = std::sqrt(fMeanSquare - fMean*fMean);
00184   }
00185   else {
00186     fRMS = 1;
00187   }
00188    fNumTriggers = numTriggers;
00189    fMeanZC = fMean * float(fNumEntries)/float(numTriggers);
00190    float ms = fMeanSquare * float(fNumEntries)/float(numTriggers) -
00191      fMeanZC*fMeanZC;
00192    if (ms>1) {
00193      fRMSZC = std::sqrt(ms);
00194    }
00195    else {
00196      fRMSZC = 1;
00197    }
00198    MSG("Pulser",Msg::kVerbose) 
00199       << "PulserSummary::Finish() finished summary in channel: "
00200       << fChannel << " Mean:  " << fMean << " RMS: " 
00201       << fRMS << " NumEntries: " << fNumEntries << endl;
00202 }

UInt_t PulserSummary::GetChannel (  )  const [inline]

Definition at line 61 of file PulserSummary.h.

References fChannel.

00061 {return fChannel;}

Int_t PulserSummary::GetEntries (  )  const [inline]
Float_t PulserSummary::GetError (  )  const [inline]
Float_t PulserSummary::GetErrorZeroCorr (  )  const [inline]

Definition at line 69 of file PulserSummary.h.

References fNumTriggers, and fRMSZC.

00069 {return fRMSZC/TMath::Sqrt(float(fNumTriggers));}  

Float_t PulserSummary::GetMean (  )  const [inline]
Float_t PulserSummary::GetMeanZeroCorr (  )  const [inline]

Definition at line 67 of file PulserSummary.h.

References fMeanZC.

00067 {return fMeanZC;}

PlexPinDiodeId PulserSummary::GetPinDiodeId (  )  const [inline]
Float_t PulserSummary::GetRMS (  )  const [inline]
Float_t PulserSummary::GetRMSZeroCorr (  )  const [inline]

Definition at line 68 of file PulserSummary.h.

References fRMSZC.

00068 {return fRMSZC;}

PlexStripEndId PulserSummary::GetStripEndId (  )  const [inline]

Definition at line 72 of file PulserSummary.h.

References fSEId.

Referenced by PulserGain::AddPoint(), and PulserDrift::PulserDrift().

00072 {return fSEId;}

Int_t PulserSummary::GetTriggers (  )  const [inline]

Definition at line 66 of file PulserSummary.h.

References fNumTriggers.

Referenced by PulserGainPin::AddPoint(), PulserGain::AddPoint(), PulserDrift::New(), and PulserDriftPin::New().

00066 {return fNumTriggers;}

void PulserSummary::SetPinDiodeId ( PlexPinDiodeId  pin  ) 

Definition at line 208 of file PulserSummary.cxx.

References fPinId.

Referenced by PulserSummaryList::Add().

00209 {
00210   fPinId = pin;
00211 
00212 }


Member Data Documentation

UInt_t PulserSummary::fChannel [private]

Definition at line 75 of file PulserSummary.h.

Referenced by Add(), AddDigit(), Finish(), and GetChannel().

Float_t PulserSummary::fMean [private]

Definition at line 77 of file PulserSummary.h.

Referenced by Add(), AddDigit(), Finish(), and GetMean().

Float_t PulserSummary::fMeanSquare [private]

Definition at line 80 of file PulserSummary.h.

Referenced by Add(), AddDigit(), and Finish().

Float_t PulserSummary::fMeanZC [private]

Definition at line 79 of file PulserSummary.h.

Referenced by Finish(), and GetMeanZeroCorr().

Int_t PulserSummary::fNumEntries [private]

Definition at line 81 of file PulserSummary.h.

Referenced by Add(), AddDigit(), Finish(), and GetEntries().

Int_t PulserSummary::fNumTriggers [private]

Definition at line 82 of file PulserSummary.h.

Referenced by Add(), AddDigit(), Finish(), GetError(), GetErrorZeroCorr(), and GetTriggers().

Definition at line 84 of file PulserSummary.h.

Referenced by Add(), AddDigit(), GetPinDiodeId(), and SetPinDiodeId().

Definition at line 85 of file PulserSummary.h.

Referenced by Add(), and AddDigit().

Float_t PulserSummary::fRMS [private]

Definition at line 76 of file PulserSummary.h.

Referenced by Finish(), GetError(), and GetRMS().

Float_t PulserSummary::fRMSZC [private]

Definition at line 78 of file PulserSummary.h.

Referenced by Finish(), GetErrorZeroCorr(), and GetRMSZeroCorr().

Definition at line 83 of file PulserSummary.h.

Referenced by Add(), AddDigit(), 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