Commit 13c389db authored by Chad Lantz's avatar Chad Lantz
Browse files

Added new Channel class members to be initialized and reset in DeclareHistograms and FillHistograms

parent 56da322e
......@@ -81,6 +81,7 @@ void Detector::DeclareHistograms(){
for( uint ch = 0; ch < m_Element.size(); ch++ ){
m_Element.at(ch)->WF_histo = new TH1D(m_Element.at(ch)->name.c_str(), (m_Element.at(ch)->name + ", " + m_Element.at(ch)->detector).c_str(), m_nSamp, 0, m_nSamp);
m_Element.at(ch)->FirstDerivative = new TH1D((m_Element.at(ch)->name + " Derivative").c_str(), (m_Element.at(ch)->name + ", " + m_Element.at(ch)->detector + " Derivative").c_str(), m_nSamp, 0, m_nSamp);
}
}
......@@ -91,6 +92,9 @@ void Detector::DeclareHistograms(){
void Detector::FillHistograms(){
for( uint ch = 0; ch < m_Element.size(); ch++ ){
m_Element.at(ch)->WF_histo->Reset();
m_Element.at(ch)->FirstDerivative->Reset();
m_Element.at(ch)->FirstDerivativeRMS = 0;
m_Element.at(ch)->CrossZeroPoints.clear();
// Loop over samples in each channel
for( uint samp = 0; samp < m_nSamp; samp++ ){
m_Element.at(ch)->WF_histo->SetBinContent( samp + 1, m_Element.at(ch)->WF[ samp ] );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment