OscFit::TemplateArray Class Reference

#include <TemplateArray.h>

List of all members.

Public Member Functions

 TemplateArray ()
virtual ~TemplateArray ()
void PrintTemplates ()
void ResetTemplates ()
void DeleteTemplates ()
Bool_t TouchTemplates ()
void AddTemplate (Run_t, Template *temp)
TemplateGetTemplate (Run_t run)
void Reset ()

Private Attributes

std::map< Run_t, Template * > fTemplateArray

Detailed Description

Definition at line 12 of file TemplateArray.h.


Constructor & Destructor Documentation

TemplateArray::TemplateArray (  ) 

Definition at line 9 of file TemplateArray.cxx.

00010 {
00011 
00012 }

TemplateArray::~TemplateArray (  )  [virtual]

Definition at line 14 of file TemplateArray.cxx.

References DeleteTemplates().

00015 {
00016   this->DeleteTemplates();
00017 }


Member Function Documentation

void TemplateArray::AddTemplate ( Run_t  run,
Template temp 
)

Definition at line 66 of file TemplateArray.cxx.

References fTemplateArray.

Referenced by OscFit::TemplateCalculator::GetData(), OscFit::TemplateCalculator::GetExpectation(), and OscFit::TemplateCalculator::GetExperiment().

00067 {
00068   if( temp==0 ) return;
00069 
00070   fTemplateArray.insert( std::pair<Run_t,Template*>(run,temp) );
00071 
00072   return;
00073 }

void TemplateArray::DeleteTemplates (  ) 

Definition at line 30 of file TemplateArray.cxx.

References fTemplateArray.

Referenced by ~TemplateArray().

00031 {
00032   std::map<Run_t,Template*>::iterator myIter = fTemplateArray.begin();
00033 
00034   for( ; myIter!=fTemplateArray.end(); myIter++ ){
00035     Template* temp = myIter->second;
00036     if( temp ) delete temp;
00037   }
00038 
00039   fTemplateArray.clear();
00040 }

Template * TemplateArray::GetTemplate ( Run_t  run  ) 

Definition at line 75 of file TemplateArray.cxx.

References fTemplateArray.

Referenced by OscFit::TemplateWriter::AddToFile(), OscFit::TemplateCalculator::GetData(), OscFit::TemplateCalculator::GetExpectation(), OscFit::TemplateCalculator::GetExperiment(), OscFit::Fitter::GetExpt(), and PrintTemplates().

00076 {
00077   Template* temp = 0;
00078 
00079   std::map<Run_t,Template*>::iterator myEntry = fTemplateArray.find(run);
00080 
00081   if( myEntry != fTemplateArray.end() ){
00082     temp = myEntry->second;
00083   }
00084 
00085   return temp;
00086 }

void TemplateArray::PrintTemplates (  ) 

Definition at line 19 of file TemplateArray.cxx.

References OscFit::AsString(), OscFit::GetNumRuns(), OscFit::GetRun(), GetTemplate(), OscFit::Template::GetTotalContent(), and run().

Referenced by OscFit::Fitter::PrintExpt().

00020 {
00021   for( Int_t irun=0; irun<OscFit::GetNumRuns(); irun++ ){
00022     Run_t run = OscFit::GetRun(irun);
00023     Template* temp = GetTemplate(run);
00024     std::cout << " [" << irun << "] " << OscFit::AsString(run) << " \t ";
00025     if( temp ) std::cout << temp->GetTotalContent() << std::endl; 
00026     else std::cout << "- " << std::endl;
00027   }
00028 }

void TemplateArray::Reset (  ) 
void TemplateArray::ResetTemplates (  ) 

Definition at line 42 of file TemplateArray.cxx.

References fTemplateArray, and OscFit::Template::Reset().

Referenced by Reset(), and OscFit::Fitter::ResetExpt().

00043 {
00044   std::map<Run_t,Template*>::iterator myIter = fTemplateArray.begin();
00045 
00046   for( ; myIter!=fTemplateArray.end(); myIter++ ){
00047     Template* temp = myIter->second;
00048     if( temp ) temp->Reset();
00049   }
00050 
00051   return;
00052 }

Bool_t TemplateArray::TouchTemplates (  ) 

Definition at line 54 of file TemplateArray.cxx.

References fTemplateArray, and OscFit::Template::GetTotalContent().

Referenced by OscFit::Fitter::TouchExpt().

00055 {
00056   std::map<Run_t,Template*>::iterator myIter = fTemplateArray.begin();
00057 
00058   for( ; myIter!=fTemplateArray.end(); myIter++ ){
00059     Template* temp = myIter->second;
00060     if( temp && temp->GetTotalContent()>0.0 ) return 1;
00061   }
00062 
00063   return 0;
00064 }


Member Data Documentation


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

Generated on 19 Jan 2018 for loon by  doxygen 1.6.1