OscFit::TemplateReader Class Reference

#include <TemplateReader.h>

List of all members.

Public Member Functions

void AddData (char *filename)
void AddMC (char *filename)
void Add (char *filename)
void ReadData ()
void ReadMC (Int_t nOsc)
void Read (Int_t nOsc)
void ListFiles ()
void LoadTemplates ()
void LoadTemplates (Int_t nOsc)
void LoadFirstGridPoint ()
void CheckTemplates ()
void PrintTemplates ()
Bool_t TouchAtmosData ()
Bool_t TouchBeamData ()
Bool_t TouchData ()
Bool_t TouchMC ()
TemplateMapGetTemplate (Int_t nDmsq, Int_t nSinsq23, Int_t nSinsq13, Int_t nDeltaCP, Int_t nHierarchy)

Static Public Member Functions

static TemplateReaderInstance ()

Private Member Functions

 TemplateReader ()
 ~TemplateReader ()

Private Attributes

char * fFileName
std::vector< char * > fFileListData
std::vector< char * > fFileListMC
std::vector< char * > fFileList

Detailed Description

Definition at line 12 of file TemplateReader.h.


Constructor & Destructor Documentation

TemplateReader::TemplateReader (  )  [private]

Definition at line 21 of file TemplateReader.cxx.

Referenced by Instance().

00022 {
00023 
00024 }

TemplateReader::~TemplateReader (  )  [private]

Definition at line 26 of file TemplateReader.cxx.

00027 {
00028 
00029 }  


Member Function Documentation

void TemplateReader::Add ( char *  filename  ) 

Definition at line 49 of file TemplateReader.cxx.

References fFileList, and fFileName.

00050 {
00051   std::cout << "  Add: \t" << filename << std::endl;
00052 
00053   fFileName = filename;
00054 
00055   fFileList.push_back( fFileName );
00056 }

void TemplateReader::AddData ( char *  filename  ) 

Definition at line 31 of file TemplateReader.cxx.

References fFileListData, and fFileName.

00032 {
00033   std::cout << "  Add Data: \t" << filename << std::endl;
00034 
00035   fFileName = filename;
00036 
00037   fFileListData.push_back( fFileName );
00038 }

void TemplateReader::AddMC ( char *  filename  ) 

Definition at line 40 of file TemplateReader.cxx.

References fFileListMC, and fFileName.

00041 {
00042   std::cout << "  Add MC: \t" << filename << std::endl;
00043 
00044   fFileName = filename;
00045 
00046   fFileListMC.push_back( fFileName );
00047 }

void TemplateReader::CheckTemplates (  ) 

Definition at line 110 of file TemplateReader.cxx.

References fFileList, fFileListMC, Instance(), and n.

00111 {
00112   if( fFileList.size() + fFileListMC.size() == 0 )
00113     return;
00114 
00115   std::cout << " *** TemplateReader::CheckTemplates() *** " << std::endl;
00116 
00117   for( UInt_t n=0; n<fFileList.size(); n++ ){
00118     TemplateIO::Instance()->CheckMC( fFileList.at(n) );
00119   }
00120 
00121   for( UInt_t n=0; n<fFileListMC.size(); n++ ){
00122     TemplateIO::Instance()->CheckMC( fFileListMC.at(n) );
00123   } 
00124 }

TemplateMap * TemplateReader::GetTemplate ( Int_t  nDmsq,
Int_t  nSinsq23,
Int_t  nSinsq13,
Int_t  nDeltaCP,
Int_t  nHierarchy 
)

Definition at line 178 of file TemplateReader.cxx.

References GetTemplate(), OscFit::TemplateGrid::Instance(), Instance(), and LoadTemplates().

Referenced by GetTemplate().

00179 {
00180   if( TemplateGrid::Instance()->TouchTemplate( nDmsq, nSinsq23, nSinsq13, nDeltaCP, nHierarchy )==0 ){
00181     Int_t nOsc = TemplateGrid::Instance()->GridID( nDmsq, nSinsq23, 
00182                                                    nSinsq13, nDeltaCP, nHierarchy );
00183     if( nOsc>=0 && nOsc<TemplateGrid::Instance()->GetNumGridPoints() ){
00184       LoadTemplates( nOsc );
00185     }
00186   }
00187 
00188   return TemplateGrid::Instance()->GetTemplate( nDmsq, nSinsq23, nSinsq13, nDeltaCP, nHierarchy );
00189 }

TemplateReader * TemplateReader::Instance (  )  [static]
void TemplateReader::ListFiles (  ) 

Definition at line 58 of file TemplateReader.cxx.

References fFileList, fFileListData, fFileListMC, and n.

00059 {
00060   std::cout << " *** TemplateReader::ListFiles() *** " << std::endl;
00061 
00062   if( fFileListData.size()>0 ){
00063     std::cout << "  Data Files: " << std::endl;
00064     for( UInt_t n=0; n<fFileListData.size(); n++ ){
00065       std::cout << "   [" << n << "] " << fFileListData.at(n) << std::endl;
00066     }
00067   }
00068 
00069   if( fFileListMC.size()>0 ){
00070     std::cout << "  MC Files: " << std::endl;
00071     for( UInt_t n=0; n<fFileListMC.size(); n++ ){
00072       std::cout << "   [" << n << "] " << fFileListMC.at(n) << std::endl;
00073     }
00074   }
00075 
00076   if( fFileList.size()>0 ){
00077     std::cout << "  Data/MC Files: " << std::endl;
00078     for( UInt_t n=0; n<fFileList.size(); n++ ){
00079       std::cout << "   [" << n << "] " << fFileList.at(n) << std::endl;
00080     }
00081   }
00082 
00083   return;
00084 }  

void TemplateReader::LoadFirstGridPoint (  ) 

Definition at line 145 of file TemplateReader.cxx.

References LoadTemplates().

Referenced by TouchAtmosData(), TouchBeamData(), TouchData(), and TouchMC().

00146 {
00147   LoadTemplates( 0 );
00148 }

void TemplateReader::LoadTemplates ( Int_t  nOsc  ) 

Definition at line 135 of file TemplateReader.cxx.

References OscFit::TemplateGrid::Instance(), Read(), ReadData(), and ReadMC().

00136 {
00137   if( TemplateGrid::Instance()->TouchTemplate( nOsc ) ) return;
00138 
00139   if( nOsc==0 ) 
00140     ReadData();      // Data-Only
00141    ReadMC( nOsc );   // MC-Only
00142   Read( nOsc );      // Data+MC
00143 }

void TemplateReader::LoadTemplates (  ) 

Definition at line 126 of file TemplateReader.cxx.

References Instance(), and n.

Referenced by GetTemplate(), and LoadFirstGridPoint().

00127 {
00128   std::cout << " --- Warning: Loading all templates --- " << std::endl;
00129 
00130   for( Int_t n=0; n<TemplateGrid::Instance()->GetNumGridPoints(); n++ ){
00131     LoadTemplates( n );
00132   }
00133 }

void TemplateReader::PrintTemplates (  ) 

Definition at line 191 of file TemplateReader.cxx.

References Instance(), and PrintTemplates().

Referenced by PrintTemplates().

00192 {
00193   TemplateIO::Instance()->PrintTemplates();
00194 }

void TemplateReader::Read ( Int_t  nOsc  ) 

Definition at line 102 of file TemplateReader.cxx.

References fFileList, fFileName, Instance(), n, and Read().

Referenced by LoadTemplates(), and Read().

00103 {
00104   for( UInt_t n=0; n<fFileList.size(); n++ ){
00105     fFileName = fFileList.at(n);
00106     TemplateIO::Instance()->Read( nOsc, fFileName );
00107   }
00108 }

void TemplateReader::ReadData (  ) 

Definition at line 86 of file TemplateReader.cxx.

References fFileListData, fFileName, Instance(), n, and ReadData().

Referenced by LoadTemplates(), and ReadData().

00087 {
00088   for( UInt_t n=0; n<fFileListData.size(); n++ ){
00089     fFileName = fFileListData.at(n);
00090     TemplateIO::Instance()->ReadData( fFileName );
00091   }
00092 }

void TemplateReader::ReadMC ( Int_t  nOsc  ) 

Definition at line 94 of file TemplateReader.cxx.

References fFileListMC, fFileName, Instance(), n, and ReadMC().

Referenced by LoadTemplates(), and ReadMC().

00095 {
00096   for( UInt_t n=0; n<fFileListMC.size(); n++ ){
00097     fFileName = fFileListMC.at(n);
00098     TemplateIO::Instance()->ReadMC( nOsc, fFileName );
00099   }
00100 }

Bool_t TemplateReader::TouchAtmosData (  ) 

Definition at line 150 of file TemplateReader.cxx.

References Instance(), LoadFirstGridPoint(), and TouchAtmosData().

Referenced by TouchAtmosData().

00151 {
00152   LoadFirstGridPoint();
00153 
00154   return TemplateGrid::Instance()->TouchAtmosData();
00155 }

Bool_t TemplateReader::TouchBeamData (  ) 

Definition at line 157 of file TemplateReader.cxx.

References Instance(), LoadFirstGridPoint(), and TouchBeamData().

Referenced by TouchBeamData().

00158 {
00159   LoadFirstGridPoint();
00160 
00161   return TemplateGrid::Instance()->TouchBeamData();
00162 }

Bool_t TemplateReader::TouchData (  ) 

Definition at line 164 of file TemplateReader.cxx.

References Instance(), LoadFirstGridPoint(), and TouchData().

Referenced by TouchData().

00165 {
00166   LoadFirstGridPoint();
00167 
00168   return TemplateGrid::Instance()->TouchData();
00169 }

Bool_t TemplateReader::TouchMC (  ) 

Definition at line 171 of file TemplateReader.cxx.

References Instance(), LoadFirstGridPoint(), and TouchMC().

Referenced by TouchMC().

00172 {
00173   LoadFirstGridPoint();
00174 
00175   return TemplateGrid::Instance()->TouchMC();
00176 }


Member Data Documentation

std::vector<char*> OscFit::TemplateReader::fFileList [private]

Definition at line 52 of file TemplateReader.h.

Referenced by Add(), CheckTemplates(), ListFiles(), and Read().

std::vector<char*> OscFit::TemplateReader::fFileListData [private]

Definition at line 50 of file TemplateReader.h.

Referenced by AddData(), ListFiles(), and ReadData().

std::vector<char*> OscFit::TemplateReader::fFileListMC [private]

Definition at line 51 of file TemplateReader.h.

Referenced by AddMC(), CheckTemplates(), ListFiles(), and ReadMC().

Definition at line 48 of file TemplateReader.h.

Referenced by Add(), AddData(), AddMC(), Read(), ReadData(), and ReadMC().


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

Generated on 16 Jan 2018 for loon by  doxygen 1.6.1