From df70d56bb1eb145ca1c90b2749666395d5519bed Mon Sep 17 00:00:00 2001
From: Jure Bericic <bericic@jlab.org>
Date: Mon, 23 Jan 2017 10:49:20 -0500
Subject: [PATCH] Added documentation for THcRawTdcHit.

Added documentation for THcRawAdcHit.
---
 src/THcRawAdcHit.cxx | 208 ++++++++++++++++++++++++++++++++++++++++++-
 src/THcRawTdcHit.cxx |  72 ++++++++++++++-
 src/THcRawTdcHit.h   |   2 +-
 3 files changed, 278 insertions(+), 4 deletions(-)

diff --git a/src/THcRawAdcHit.cxx b/src/THcRawAdcHit.cxx
index 0eea62f..9acb5df 100644
--- a/src/THcRawAdcHit.cxx
+++ b/src/THcRawAdcHit.cxx
@@ -1,12 +1,218 @@
 /**
 \class THcRawAdcHit
 \ingroup DetSupport
-
 \brief Class representing a single raw ADC hit.
 
 It supports rich data from flash 250 ADC modules.
 */
 
+/**
+\fn THcRawAdcHit::THcRawAdcHit()
+\brief Constructor.
+*/
+
+/**
+\fn THcRawAdcHit& THcRawAdcHit::operator=(const THcRawAdcHit& right)
+\brief Assignment operator.
+\param[in] right Raw ADC hit to be assigned.
+*/
+
+/**
+\fn THcRawAdcHit::~THcRawAdcHit()
+\brief Destructor.
+*/
+
+/**
+\fn void THcRawAdcHit::Clear(Option_t* opt="")
+\brief Clears variables before next event.
+\param[in] opt Maybe used in base clas... Not sure.
+*/
+
+/**
+\fn void THcRawAdcHit::SetData(Int_t data)
+\brief Sets raw ADC value.
+\param[in] data Raw ADC value. In channels.
+\throw std::out_of_range Tried to set too many pulses.
+
+Should be used for old style ADCs.
+*/
+
+/**
+\fn void THcRawAdcHit::SetSample(Int_t data)
+\brief Sets raw signal sample.
+\param[in] data Raw signal sample. In channels.
+\throw std::out_of_range Tried to set too many samples.
+*/
+
+/**
+\fn void THcRawAdcHit::SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedestal, Int_t peak)
+\brief Sets various bits of ADC data.
+\param[in] data Raw pulse integral. In channels.
+\param[in] time Raw pulse time. In subsamples.
+\param[in] pedestal Raw signal pedestal. In channels.
+\param[in] peak Raw pulse amplitude. In channels.
+\throw std::out_of_range Tried to set too many pulses.
+
+Should be used for flash 250 modules.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetRawData(UInt_t iPulse=0) const
+\brief Gets raw pulse integral. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+\throw std::out_of_range Tried to get nonexisting pulse.
+
+Returns 0 if tried to access first pulse but no pulses are set.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetAdcTime(UInt_t iPulse=0) const
+\brief Gets raw pulse time. In subsamples.
+\param[in] iPulse Sequential number of requested pulse.
+\throw std::out_of_range Tried to get nonexisting pulse.
+
+Returns 0 if tried to access first pulse but no pulses are set.
+Returns 0 if no pulse time is set.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetAdcPedestal(UInt_t iPulse=0) const
+\brief Gets raw signal pedestal. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+\throw std::out_of_range Tried to get nonexisting pulse.
+
+Returns 0 if tried to access first pulse but no pulses are set.
+Returns 0 if no signal pedestal is set.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetAdcPulse(UInt_t iPulse=0) const
+\brief Gets raw pulse amplitude. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+\throw std::out_of_range Tried to get nonexisting pulse.
+
+Returns 0 if tried to access first pulse but no pulses are set.
+Returns 0 if no pulse peak is set.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetSample(UInt_t iSample) const
+\brief Gets raw signal sample. In channels.
+\param[in] iSample Sequential number of requested sample.
+\throw std::out_of_range Tried to get nonexisting sample.
+
+Returns 0 if tried to access first sample but no samples are set.
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const
+\brief Gets average of raw samples. In channels.
+\param[in] iSampleLow Sequential number of first sample to be averaged.
+\param[in] iSampleHigh Sequential number of last sample to be averaged.
+\throw std::out_of_range Tried to average over nonexisting sample.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetIntegral(UInt_t iSampleLow, UInt_t iSampleHigh) const
+\brief Gets integral of raw samples. In channels.
+\param[in] iSampleLow Sequential number of first sample to be integrated.
+\param[in] iSampleHigh Sequential number of last sample to be integrated.
+\throw std::out_of_range Tried to integrate over nonexisting sample.
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetData(UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh) const
+\brief Gets pedestal subtracted integral of samples. In channels.
+\param[in] iPedLow Sequential number of first sample to be averaged for pedestal value.
+\param[in] iPedHigh Sequential number of last sample to be averaged for pedestal value.
+\param[in] iIntLow Sequential number of first sample to be integrated.
+\param[in] iIntHigh Sequential number of last sample to be integrated.
+*/
+
+/**
+\fn UInt_t THcRawAdcHit::GetNPulses() const
+\brief Gets number of set pulses.
+*/
+
+/**
+\fn UInt_t THcRawAdcHit::GetNSamples() const
+\brief Gets number of set samples.
+*/
+
+/**
+\fn Bool_t THcRawAdcHit::HasMulti() const
+\brief Queries whether data is from flash 250 module.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetPedRaw() const
+\brief Gets raw signal pedestal. In channels.
+
+Returns 0 if no signal pedestal is set.
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetPulseIntRaw(UInt_t iPulse=0) const
+\brief Gets raw pulse integral. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+
+Check iPulse validity before calling!
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetPulseAmpRaw(UInt_t iPulse=0) const
+\brief Gets raw pulse amplitude. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+
+Check iPulse validity before calling!
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetPulseTimeRaw(UInt_t iPulse=0) const
+\brief Gets raw pulse time. In subsamples.
+\param[in] iPulse Sequential number of requested pulse.
+
+Check iPulse validity before calling!
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetPed() const
+\brief Gets sample pedestal. In channels.
+
+Returns 0 if no signal pedestal is set.
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetPulseInt(UInt_t iPulse=0) const
+\brief Gets pedestal subtracted pulse integral. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+
+Check iPulse validity before calling!
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetPulseAmp(UInt_t iPulse=0) const
+\brief Gets pedestal subtracted pulse amplitude. In channels.
+\param[in] iPulse Sequential number of requested pulse.
+
+Check iPulse validity before calling!
+*/
+
+/**
+\fn Int_t THcRawAdcHit::GetSampleIntRaw() const
+\brief Gets raw integral of samples. In channels.
+*/
+
+/**
+\fn Double_t THcRawAdcHit::GetSampleInt() const
+\brief Gets pedestal subtracted integral of samples. In channels.
+*/
+
+// TODO: Disallow using both SetData and SetDataTimePedestalPeak.
+// TODO: Add checks to new getters.
+// TODO: Deprecate and remove old getters.
+
+
 #include "THcRawAdcHit.h"
 
 #include <stdexcept>
diff --git a/src/THcRawTdcHit.cxx b/src/THcRawTdcHit.cxx
index 6850206..d2ec274 100644
--- a/src/THcRawTdcHit.cxx
+++ b/src/THcRawTdcHit.cxx
@@ -1,10 +1,78 @@
 /**
 \class THcRawTdcHit
 \ingroup DetSupport
-
 \brief Class representing a single raw TDC hit.
 */
 
+/**
+\fn THcRawTdcHit::THcRawTdcHit()
+\brief Constructor.
+*/
+
+/**
+\fn THcRawTdcHit& THcRawTdcHit::operator=(const THcRawTdcHit& right)
+\brief Assignment operator.
+\param[in] right Raw TDC hit to be assigned.
+*/
+
+/**
+\fn THcRawTdcHit::~THcRawTdcHit()
+\brief Destructor.
+*/
+
+/**
+\fn void THcRawTdcHit::Clear(Option_t* opt="")
+\brief Clears variables before next event.
+\param[in] opt Maybe used in base clas... Not sure.
+*/
+
+/**
+\fn void THcRawTdcHit::SetTime(Int_t time)
+\brief Sets raw TDC time from the modules. In channels.
+\param[in] time Raw TDC time from the modules. In channels.
+\throw std::out_of_range Tried to set too many hits.
+*/
+
+/**
+\fn void THcRawTdcHit::SetRefTime(Int_t refTime)
+\brief Sets reference time. In channels.
+\param[in] refTime Reference time. In channels.
+*/
+
+/**
+\fn Int_t THcRawTdcHit::GetTimeRaw(UInt_t iHit=0) const
+\brief Gets raw TDC time. In channels.
+\param[in] iHit Sequential number of requested hit.
+\throw std::out_of_range Tried to access nonexisting hit.
+
+Returns 0 if tried to access first hit but no hits are set.
+*/
+
+/**
+\fn Int_T THcRawTdcHit::GetTime(UInt_t iHit=0) const
+\brief Gets TDC time. In channels.
+\param[in] iHit Sequential number of requested hit.
+
+Returned time is corrected for reference time, if available.
+*/
+
+/**
+\fn Int_t THcRawTdcHit::GetRefTime() const
+\brief Gets reference time. In channels.
+\throw std::runtime_error No reference time was set.
+*/
+
+/**
+\fn Bool_t THcRawTdcHit::HasRefTime() const
+\brief Queries whether reference time has been set.
+*/
+
+/**
+\fn UInt_t THcRawTdcHit::GetNHits() const
+\brief Gets the number of set hits.
+*/
+
+
 #include "THcRawTdcHit.h"
 
 #include <stdexcept>
@@ -110,7 +178,7 @@ Int_t THcRawTdcHit::GetRefTime() const {
 }
 
 
-Int_t THcRawTdcHit::HasRefTime() const {
+Bool_t THcRawTdcHit::HasRefTime() const {
   return fHasRefTime;
 }
 
diff --git a/src/THcRawTdcHit.h b/src/THcRawTdcHit.h
index daa7e96..da2deca 100644
--- a/src/THcRawTdcHit.h
+++ b/src/THcRawTdcHit.h
@@ -19,7 +19,7 @@ class THcRawTdcHit : public TObject {
     Int_t GetTime(UInt_t iHit=0) const;
     Int_t GetRefTime() const;
 
-    Int_t HasRefTime() const;
+    Bool_t HasRefTime() const;
 
     UInt_t GetNHits() const;
 
-- 
GitLab