LArSoft  v09_90_00
Liquid Argon Software toolkit - https://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 18 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:30
const std::vector< short > & Waveform() const
Definition: OpDetPulse.h:54
unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:28
unsigned int FirstSample() const
Definition: OpDetPulse.h:74
unsigned int fPMTFrame
frame number where pulse begins
Definition: OpDetPulse.h:27
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:24
unsigned int PMTFrame() const
Definition: OpDetPulse.h:70
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:24

Member Function Documentation

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

Definition at line 74 of file OpDetPulse.h.

References fFirstSample.

Referenced by OpDetPulse(), and SetFirstSample().

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

Definition at line 46 of file OpDetPulse.cxx.

References fWaveform, and Samples().

47  {
48  // endbin set to zero or not supplied means go to end of vector
49  if (endbin == 0) endbin = Samples();
50 
51  // Some error trapping for stupid integration limits
52  if (endbin < startbin)
53  throw cet::exception("OpDetPulse")
54  << " Trying to integrate between illegal limits : " << startbin << " " << endbin << "\n";
55  if (endbin > Samples())
56  throw cet::exception("OpDetPulse")
57  << " Trying to integrate between illegal limits : " << startbin << " " << endbin << "\n";
58 
59  unsigned int TotalIntegral = 0;
60  // Loop over vector to return the integral
61  for (size_t i = startbin; i != endbin; ++i) {
62  TotalIntegral += fWaveform.at(i);
63  }
64 
65  return TotalIntegral;
66  }
std::vector< short > fWaveform
Definition: OpDetPulse.h:30
unsigned short Samples() const
Definition: OpDetPulse.h:66
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().

63 {
64  return fOpChannel;
65 }
unsigned short fOpChannel
channel in the readout
Definition: OpDetPulse.h:24
unsigned int raw::OpDetPulse::PMTFrame ( ) const
inline

Definition at line 70 of file OpDetPulse.h.

References fPMTFrame.

Referenced by OpDetPulse().

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

Definition at line 66 of file OpDetPulse.h.

References fWaveform.

Referenced by Integral().

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

Definition at line 82 of file OpDetPulse.h.

References fFirstSample, and FirstSample().

83 {
85 }
unsigned int fFirstSample
first sample number within pmt frame
Definition: OpDetPulse.h:28
unsigned int FirstSample() const
Definition: OpDetPulse.h:74
void raw::OpDetPulse::SetPMTFrame ( unsigned int  Frame)
inline

Definition at line 78 of file OpDetPulse.h.

References fPMTFrame.

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

Definition at line 54 of file OpDetPulse.h.

References fWaveform.

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

55 {
56  return fWaveform;
57 }
std::vector< short > fWaveform
Definition: OpDetPulse.h:30
std::vector< short > & raw::OpDetPulse::Waveform ( )
inline

Definition at line 58 of file OpDetPulse.h.

References fWaveform.

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

Member Data Documentation

unsigned int raw::OpDetPulse::fFirstSample
private

first sample number within pmt frame

Definition at line 28 of file OpDetPulse.h.

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

unsigned short raw::OpDetPulse::fOpChannel
private

channel in the readout

Definition at line 24 of file OpDetPulse.h.

Referenced by OpChannel(), and OpDetPulse().

unsigned int raw::OpDetPulse::fPMTFrame
private

frame number where pulse begins

Definition at line 27 of file OpDetPulse.h.

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

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

Definition at line 30 of file OpDetPulse.h.

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


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