All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
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.

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

Definition at line 40 of file OpDetPulse.cxx.

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

Member Function Documentation

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

Definition at line 64 of file OpDetPulse.h.

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

Definition at line 48 of file OpDetPulse.cxx.

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:31
unsigned short Samples() const
Definition: OpDetPulse.h:62
unsigned short raw::OpDetPulse::OpChannel ( ) const
inline

Definition at line 61 of file OpDetPulse.h.

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

Definition at line 63 of file OpDetPulse.h.

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

Definition at line 62 of file OpDetPulse.h.

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

Definition at line 66 of file OpDetPulse.h.

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

Definition at line 65 of file OpDetPulse.h.

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

Definition at line 59 of file OpDetPulse.h.

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

Definition at line 60 of file OpDetPulse.h.

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

Member Data Documentation

unsigned int raw::OpDetPulse::fFirstSample
private

first sample number within pmt frame

Definition at line 29 of file OpDetPulse.h.

unsigned short raw::OpDetPulse::fOpChannel
private

channel in the readout

Definition at line 25 of file OpDetPulse.h.

unsigned int raw::OpDetPulse::fPMTFrame
private

frame number where pulse begins

Definition at line 28 of file OpDetPulse.h.

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

Definition at line 31 of file OpDetPulse.h.


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