GetFidModule Class Reference

#include <GetFidModule.h>

Inheritance diagram for GetFidModule:

JobCModule List of all members.

Public Member Functions

 GetFidModule ()
 ~GetFidModule ()
JobCResult Ana (const MomNavigator *mom)
const RegistryDefaultConfig () const
void Config (const Registry &r)

Private Attributes

Int_t fFirstOnly
Int_t fRun2
Int_t fRun4
Int_t fFidCrate2
Int_t fFidCrate4

Detailed Description

Id
GetFidModule.h,v 1.3 2014/01/04 23:19:15 evansj Exp

(Document me!)

tagg@minos.phy.tufts.edu

Definition at line 14 of file GetFidModule.h.


Constructor & Destructor Documentation

GetFidModule::GetFidModule (  ) 

Definition at line 23 of file GetFidModule.cxx.

00023                            : 
00024   fFirstOnly(0),
00025   fRun2(0),
00026   fRun4(0),
00027   fFidCrate2(0),
00028   fFidCrate4(0)
00029 {
00030 }

GetFidModule::~GetFidModule (  ) 

Definition at line 33 of file GetFidModule.cxx.

00034 {
00035 }


Member Function Documentation

JobCResult GetFidModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 39 of file GetFidModule.cxx.

References digit(), fFidCrate2, fFidCrate4, Form(), fRun2, fRun4, JobCResult::kPassed, outfile, and run().

00040 {
00041   vector<const RawVaTimingMonitorBlock*> vBlocks = DataUtil::GetRawBlocks<RawVaTimingMonitorBlock>(mom);
00042   
00043   for (vector<const RawVaTimingMonitorBlock*>::const_iterator it = vBlocks.begin();
00044        it != vBlocks.end();
00045        ++it){
00046     
00047     const RawVaTimingMonitorBlock* rvtmb = *it;
00048     
00049     Double_t secFromEpoch = rvtmb->GetTimeStamp().GetSeconds();
00050     Int_t run = rvtmb->GetRun();
00051     string errorFileName = Form("Errors%d.txt", run);
00052     
00053     Int_t nRvtmbDigits = rvtmb->GetNumberOfDigits();
00054     
00055     if (nRvtmbDigits > 1){
00056       ofstream errorFile(errorFileName.c_str(),
00057                          ios_base::app | ios_base::out);
00058       errorFile << "Number of rvtmb digits > 1, which is strange."
00059                 << endl;
00060     }
00061     
00062     //We only expect 1 digit, so use the first one:
00063     const RawDigit* digit = rvtmb->At(0);
00064   
00065     if (2 == digit->GetChannel().GetCrate()){
00066       Bool_t writeOut = false;
00067       Int_t timingFiducialCrate2 = digit->GetTDC();
00068       if (run != fRun2){
00069         writeOut = true; fRun2 = run;
00070       }
00071       if (timingFiducialCrate2 != fFidCrate2){
00072         writeOut = true; fFidCrate2 = timingFiducialCrate2;
00073       }
00074       if(writeOut) {
00075         string outFileName = Form("crate2fid%d.txt", run);
00076         ofstream outfile(outFileName.c_str(),ios_base::app | ios_base::out);
00077         outfile.precision(20);
00078         outfile << run << "\t" << timingFiducialCrate2 << "\t" << secFromEpoch << endl;
00079       }
00080     }
00081     if (4 == digit->GetChannel().GetCrate()){
00082       Bool_t writeOut = false;
00083       Int_t timingFiducialCrate4 = digit->GetTDC();
00084       if (run != fRun4){
00085         writeOut = true; fRun4 = run;
00086       }
00087       if (timingFiducialCrate4 != fFidCrate4){
00088         writeOut = true; fFidCrate4 = timingFiducialCrate4;
00089       }
00090       if(writeOut) {
00091         string outFileName = Form("crate4fid%d.txt", run);
00092         ofstream outfile(outFileName.c_str(),ios_base::app | ios_base::out);
00093         outfile.precision(20);
00094         outfile << run << "\t" << timingFiducialCrate4 << "\t" << secFromEpoch << endl;
00095       }
00096     }
00097   }
00098   return JobCResult::kPassed;
00099 
00100 }

void GetFidModule::Config ( const Registry r  )  [virtual]

Return the actual configuration. If your module directly pulls its configuration from the fConfig Registry, you don't need to override this. Override if you have local config variables.

Reimplemented from JobCModule.

Definition at line 126 of file GetFidModule.cxx.

References fFirstOnly, and Registry::GetInt().

00127 {
00131   fFirstOnly = r.GetInt("FirstOnly");
00132 }

const Registry & GetFidModule::DefaultConfig (  )  const [virtual]

Get the default configuration registry. This should normally be overridden. One useful idiom is to implement it like:

const Registry& MyModule::DefaultConfig() const { static Registry cfg; // never is destroyed if (cfg.Size()) return cfg; // already filled it // set defaults: cfg.Set("TheAnswer",42); cfg.Set("Units","unknown"); return cfg; }

Reimplemented from JobCModule.

Definition at line 104 of file GetFidModule.cxx.

References JobCModule::GetName(), Registry::LockValues(), Registry::Set(), and Registry::UnLockValues().

00105 {
00109   static Registry r; // Default configuration for module
00110 
00111   // Set name of config
00112   std::string name = this->GetName();
00113   name += ".config.default";
00114   r.SetName(name.c_str());
00115 
00116   // Set values in configuration
00117   r.UnLockValues();
00118   r.Set("FirstOnly", 1);
00119   r.LockValues();
00120 
00121   return r;
00122 }


Member Data Documentation

Int_t GetFidModule::fFidCrate2 [private]

Definition at line 36 of file GetFidModule.h.

Referenced by Ana().

Int_t GetFidModule::fFidCrate4 [private]

Definition at line 37 of file GetFidModule.h.

Referenced by Ana().

Int_t GetFidModule::fFirstOnly [private]

Definition at line 31 of file GetFidModule.h.

Referenced by Config().

Int_t GetFidModule::fRun2 [private]

Definition at line 34 of file GetFidModule.h.

Referenced by Ana().

Int_t GetFidModule::fRun4 [private]

Definition at line 35 of file GetFidModule.h.

Referenced by Ana().


The documentation for this class was generated from the following files:
Generated on Mon Aug 11 01:05:53 2014 for loon by  doxygen 1.4.7