LArSoft  v08_22_00
Liquid Argon Software toolkit - http://larsoft.org/
raw::OpDetPulse Class Reference

#include "OpDetPulse.h"

Public Member Functions

 OpDetPulse ()
 
 OpDetPulse (unsigned short OpChannel, std::vector< short > Waveform, unsigned int PMTFrame, unsigned int FirstSample)
 
 OpDetPulse (unsigned short OpChannel)
 
int Integral (unsigned short startbin=0, unsigned short endbin=0)
 
const std::vector< short > & Waveform () const
 
std::vector< short > & Waveform ()
 
unsigned short OpChannel () const
 
unsigned short Samples () const
 
unsigned int PMTFrame () const
 
unsigned int FirstSample () const
 
void SetPMTFrame (unsigned int Frame)
 
void SetFirstSample (unsigned int FirstSample)
 

Private Attributes

unsigned short fOpChannel
 channel in the readout More...
 
unsigned int fPMTFrame
 frame number where pulse begins More...
 
unsigned int fFirstSample
 first sample number within pmt frame More...
 
std::vector< short > fWaveform
 

Detailed Description

Definition at line 19 of file OpDetPulse.h.

Constructor & Destructor Documentation

raw::OpDetPulse::OpDetPulse ( )

Definition at line 20 of file OpDetPulse.cxx.

21  {
22  /* mf::LogWarning("OpDetPulse") <<"Warning : OpDetPulse default constructor called without "
23  <<"specification of OpChannel. This is not recommended";
24  */
25  }
raw::OpDetPulse::OpDetPulse ( unsigned short  OpChannel,
std::vector< short >  Waveform,
unsigned int  PMTFrame,
unsigned int  FirstSample 
)

Definition at line 28 of file OpDetPulse.cxx.

References fFirstSample, FirstSample(), fOpChannel, fPMTFrame, fWaveform, OpChannel(), PMTFrame(), and Waveform().

32  {
37  }
unsigned short OpChannel() const
Definition: OpDetPulse.h:62
std::vector< short > fWaveform
Definition: OpDetPulse.h:32
const std::vector< short > & Waveform() const
Definition: OpDetPulse.h:60
unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:30
unsigned int FirstSample() const
Definition: OpDetPulse.h:65
unsigned int fPMTFrame
frame number where pulse begins
Definition: OpDetPulse.h:29
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:26
unsigned int PMTFrame() const
Definition: OpDetPulse.h:64
raw::OpDetPulse::OpDetPulse ( unsigned short  OpChannel)

Definition at line 40 of file OpDetPulse.cxx.

References fOpChannel, and OpChannel().

41  {
43  }
unsigned short OpChannel() const
Definition: OpDetPulse.h:62
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:26

Member Function Documentation

unsigned int raw::OpDetPulse::FirstSample ( ) const
inline

Definition at line 65 of file OpDetPulse.h.

References fFirstSample.

Referenced by OpDetPulse(), and SetFirstSample().

65 { return fFirstSample; }
unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:30
int raw::OpDetPulse::Integral ( unsigned short  startbin = 0,
unsigned short  endbin = 0 
)

Definition at line 48 of file OpDetPulse.cxx.

References fWaveform, and Samples().

49  {
50  // endbin set to zero or not supplied means go to end of vector
51  if(endbin==0) endbin=Samples();
52 
53  // Some error trapping for stupid integration limits
54  if(endbin < startbin)
55  throw cet::exception("OpDetPulse")
56  <<" Trying to integrate between illegal limits : " <<startbin<<" " <<endbin << "\n";
57  if(endbin > Samples())
58  throw cet::exception("OpDetPulse")
59  <<" Trying to integrate between illegal limits : "<< startbin<<" " <<endbin << "\n";
60 
61  unsigned int TotalIntegral = 0;
62  // Loop over vector to return the integral
63  for(size_t i=startbin; i!=endbin; ++i)
64  {
65  TotalIntegral+=fWaveform.at(i);
66  }
67 
68  return TotalIntegral;
69  }
std::vector< short > fWaveform
Definition: OpDetPulse.h:32
unsigned short Samples() const
Definition: OpDetPulse.h:63
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
unsigned short raw::OpDetPulse::OpChannel ( ) const
inline

Definition at line 62 of file OpDetPulse.h.

References fOpChannel.

Referenced by opdet::OpDigiAna::analyze(), and OpDetPulse().

62 { return fOpChannel; }
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:26
unsigned int raw::OpDetPulse::PMTFrame ( ) const
inline

Definition at line 64 of file OpDetPulse.h.

References fPMTFrame.

Referenced by OpDetPulse().

64 { return fPMTFrame; }
unsigned int fPMTFrame
frame number where pulse begins
Definition: OpDetPulse.h:29
unsigned short raw::OpDetPulse::Samples ( ) const
inline

Definition at line 63 of file OpDetPulse.h.

References fWaveform.

Referenced by Integral().

63 { return fWaveform.size(); }
std::vector< short > fWaveform
Definition: OpDetPulse.h:32
void raw::OpDetPulse::SetFirstSample ( unsigned int  FirstSample)
inline

Definition at line 67 of file OpDetPulse.h.

References fFirstSample, and FirstSample().

unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:30
unsigned int FirstSample() const
Definition: OpDetPulse.h:65
void raw::OpDetPulse::SetPMTFrame ( unsigned int  Frame)
inline

Definition at line 66 of file OpDetPulse.h.

References fPMTFrame.

66 { fPMTFrame=Frame; }
unsigned int fPMTFrame
frame number where pulse begins
Definition: OpDetPulse.h:29
const std::vector< short > & raw::OpDetPulse::Waveform ( ) const
inline

Definition at line 60 of file OpDetPulse.h.

References fWaveform.

Referenced by opdet::OpDigiAna::analyze(), and OpDetPulse().

60 { return fWaveform; }
std::vector< short > fWaveform
Definition: OpDetPulse.h:32
std::vector< short > & raw::OpDetPulse::Waveform ( )
inline

Definition at line 61 of file OpDetPulse.h.

References fWaveform.

61 { return fWaveform; }
std::vector< short > fWaveform
Definition: OpDetPulse.h:32

Member Data Documentation

unsigned int raw::OpDetPulse::fFirstSample
private

first sample number within pmt frame

Definition at line 30 of file OpDetPulse.h.

Referenced by FirstSample(), OpDetPulse(), and SetFirstSample().

unsigned short raw::OpDetPulse::fOpChannel
private

channel in the readout

Definition at line 26 of file OpDetPulse.h.

Referenced by OpChannel(), and OpDetPulse().

unsigned int raw::OpDetPulse::fPMTFrame
private

frame number where pulse begins

Definition at line 29 of file OpDetPulse.h.

Referenced by OpDetPulse(), PMTFrame(), and SetPMTFrame().

std::vector<short> raw::OpDetPulse::fWaveform
private

Definition at line 32 of file OpDetPulse.h.

Referenced by Integral(), OpDetPulse(), Samples(), and Waveform().


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